@tanstack/solid-query 6.0.0-beta.4 → 6.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_tsup-dts-rollup.d.cts +39 -68
- package/build/_tsup-dts-rollup.d.ts +39 -68
- package/build/dev.cjs +11 -6
- package/build/dev.d.cts +4 -7
- package/build/dev.d.ts +4 -7
- package/build/dev.js +12 -7
- package/build/index.cjs +11 -6
- package/build/index.d.cts +4 -7
- package/build/index.d.ts +4 -7
- package/build/index.js +12 -7
- package/package.json +5 -5
- package/src/QueryClientProvider.tsx +1 -1
- package/src/index.ts +3 -3
- package/src/infiniteQueryOptions.ts +3 -15
- package/src/mutationOptions.ts +7 -7
- package/src/queryOptions.ts +3 -3
- package/src/types.ts +6 -6
- package/src/useBaseQuery.ts +12 -1
- package/src/useMutation.ts +12 -5
- package/src/useQueries.ts +2 -2
|
@@ -19,7 +19,6 @@ import { dehydrate } from '@tanstack/query-core';
|
|
|
19
19
|
import { DehydratedState } from '@tanstack/query-core';
|
|
20
20
|
import { DehydrateOptions } from '@tanstack/query-core';
|
|
21
21
|
import { DistributiveOmit } from '@tanstack/query-core';
|
|
22
|
-
import { Enabled } from '@tanstack/query-core';
|
|
23
22
|
import { EnsureInfiniteQueryDataOptions } from '@tanstack/query-core';
|
|
24
23
|
import { EnsureQueryDataOptions } from '@tanstack/query-core';
|
|
25
24
|
import { environmentManager } from '@tanstack/query-core';
|
|
@@ -55,12 +54,11 @@ import { InvalidateOptions } from '@tanstack/query-core';
|
|
|
55
54
|
import { InvalidateQueryFilters } from '@tanstack/query-core';
|
|
56
55
|
import { isCancelledError } from '@tanstack/query-core';
|
|
57
56
|
import { isServer } from '@tanstack/query-core';
|
|
58
|
-
import { JSX } from '
|
|
57
|
+
import type { JSX } from '@solidjs/web';
|
|
59
58
|
import { keepPreviousData } from '@tanstack/query-core';
|
|
60
59
|
import { ManagedTimerId } from '@tanstack/query-core';
|
|
61
60
|
import { matchMutation } from '@tanstack/query-core';
|
|
62
61
|
import { matchQuery } from '@tanstack/query-core';
|
|
63
|
-
import type { MockInstance } from 'vitest';
|
|
64
62
|
import { MutateFunction } from '@tanstack/query-core';
|
|
65
63
|
import { MutateOptions } from '@tanstack/query-core';
|
|
66
64
|
import { Mutation } from '@tanstack/query-core';
|
|
@@ -79,12 +77,10 @@ import { MutationObserverLoadingResult } from '@tanstack/query-core';
|
|
|
79
77
|
import { MutationObserverOptions } from '@tanstack/query-core';
|
|
80
78
|
import { MutationObserverResult } from '@tanstack/query-core';
|
|
81
79
|
import { MutationObserverSuccessResult } from '@tanstack/query-core';
|
|
82
|
-
import { MutationOptions } from '@tanstack/query-core';
|
|
83
80
|
import { MutationScope } from '@tanstack/query-core';
|
|
84
81
|
import { MutationState } from '@tanstack/query-core';
|
|
85
82
|
import { MutationStatus } from '@tanstack/query-core';
|
|
86
83
|
import { NetworkMode } from '@tanstack/query-core';
|
|
87
|
-
import { NoInfer as NoInfer_2 } from '@tanstack/query-core';
|
|
88
84
|
import { NonUndefinedGuard } from '@tanstack/query-core';
|
|
89
85
|
import { noop } from '@tanstack/query-core';
|
|
90
86
|
import { NotifyEvent } from '@tanstack/query-core';
|
|
@@ -93,15 +89,14 @@ import { notifyManager } from '@tanstack/query-core';
|
|
|
93
89
|
import { NotifyOnChangeProps } from '@tanstack/query-core';
|
|
94
90
|
import { OmitKeyof } from '@tanstack/query-core';
|
|
95
91
|
import { onlineManager } from '@tanstack/query-core';
|
|
96
|
-
import { Options } from 'tsup';
|
|
97
92
|
import { Override } from '@tanstack/query-core';
|
|
98
|
-
import type { ParentProps } from 'solid-js';
|
|
99
93
|
import { partialMatchKey } from '@tanstack/query-core';
|
|
100
94
|
import { PlaceholderDataFunction } from '@tanstack/query-core';
|
|
101
95
|
import { QueriesObserver } from '@tanstack/query-core';
|
|
102
96
|
import { QueriesObserverOptions } from '@tanstack/query-core';
|
|
103
97
|
import { QueriesPlaceholderDataFunction } from '@tanstack/query-core';
|
|
104
98
|
import { Query } from '@tanstack/query-core';
|
|
99
|
+
import { QueryBooleanOption } from '@tanstack/query-core';
|
|
105
100
|
import { QueryCache } from '@tanstack/query-core';
|
|
106
101
|
import { QueryCacheNotifyEvent } from '@tanstack/query-core';
|
|
107
102
|
import { QueryClient as QueryClient_2 } from '@tanstack/query-core';
|
|
@@ -122,7 +117,6 @@ import { QueryObserverPlaceholderResult } from '@tanstack/query-core';
|
|
|
122
117
|
import { QueryObserverRefetchErrorResult } from '@tanstack/query-core';
|
|
123
118
|
import { QueryObserverResult } from '@tanstack/query-core';
|
|
124
119
|
import { QueryObserverSuccessResult } from '@tanstack/query-core';
|
|
125
|
-
import { QueryOptions } from '@tanstack/query-core';
|
|
126
120
|
import { QueryPersister } from '@tanstack/query-core';
|
|
127
121
|
import { QueryState } from '@tanstack/query-core';
|
|
128
122
|
import { QueryStatus } from '@tanstack/query-core';
|
|
@@ -145,15 +139,10 @@ import { TimeoutProvider } from '@tanstack/query-core';
|
|
|
145
139
|
import { UnsetMarker } from '@tanstack/query-core';
|
|
146
140
|
import { unsetMarker } from '@tanstack/query-core';
|
|
147
141
|
import { Updater } from '@tanstack/query-core';
|
|
148
|
-
import { UserConfig } from 'vite';
|
|
149
142
|
import { WithRequired } from '@tanstack/query-core';
|
|
150
143
|
|
|
151
144
|
export { AnyDataTag }
|
|
152
145
|
|
|
153
|
-
export declare function Blink(props: {
|
|
154
|
-
duration: number;
|
|
155
|
-
} & ParentProps): JSX;
|
|
156
|
-
|
|
157
146
|
export { CancelledError }
|
|
158
147
|
|
|
159
148
|
export { CancelOptions }
|
|
@@ -172,14 +161,6 @@ export { dataTagErrorSymbol }
|
|
|
172
161
|
|
|
173
162
|
export { dataTagSymbol }
|
|
174
163
|
|
|
175
|
-
export declare const default_alias: any[];
|
|
176
|
-
|
|
177
|
-
export declare const default_alias_1: any[];
|
|
178
|
-
|
|
179
|
-
export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
180
|
-
|
|
181
|
-
export declare const default_alias_3: UserConfig;
|
|
182
|
-
|
|
183
164
|
export { DefaultedInfiniteQueryObserverOptions }
|
|
184
165
|
|
|
185
166
|
export { DefaultedQueryObserverOptions }
|
|
@@ -200,13 +181,13 @@ export { defaultShouldDehydrateQuery }
|
|
|
200
181
|
|
|
201
182
|
export { DefinedInfiniteQueryObserverResult }
|
|
202
183
|
|
|
203
|
-
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
184
|
+
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
204
185
|
initialData: NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>> | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>);
|
|
205
186
|
}>;
|
|
206
187
|
export { DefinedInitialDataInfiniteOptions }
|
|
207
188
|
export { DefinedInitialDataInfiniteOptions as DefinedInitialDataInfiniteOptions_alias_1 }
|
|
208
189
|
|
|
209
|
-
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
190
|
+
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
210
191
|
initialData: TQueryFnData | (() => TQueryFnData);
|
|
211
192
|
}>;
|
|
212
193
|
export { DefinedInitialDataOptions }
|
|
@@ -237,8 +218,6 @@ export { DehydrateOptions }
|
|
|
237
218
|
|
|
238
219
|
export { DistributiveOmit }
|
|
239
220
|
|
|
240
|
-
export { Enabled }
|
|
241
|
-
|
|
242
221
|
export { EnsureInfiniteQueryDataOptions }
|
|
243
222
|
|
|
244
223
|
export { EnsureQueryDataOptions }
|
|
@@ -337,6 +316,25 @@ export { InfiniteQueryObserverResult }
|
|
|
337
316
|
|
|
338
317
|
export { InfiniteQueryObserverSuccessResult }
|
|
339
318
|
|
|
319
|
+
declare interface InfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
320
|
+
queryKey: TQueryKey;
|
|
321
|
+
/**
|
|
322
|
+
* Only applicable while rendering queries on the server with streaming.
|
|
323
|
+
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
324
|
+
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
325
|
+
* Defaults to `false`.
|
|
326
|
+
*/
|
|
327
|
+
deferStream?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
330
|
+
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
331
|
+
* Setting `suspense` to `false` will be a no-op.
|
|
332
|
+
*/
|
|
333
|
+
suspense?: boolean;
|
|
334
|
+
}
|
|
335
|
+
export { InfiniteQueryOptions }
|
|
336
|
+
export { InfiniteQueryOptions as InfiniteQueryOptions_alias_1 }
|
|
337
|
+
|
|
340
338
|
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>): ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>> & {
|
|
341
339
|
queryKey: DataTag<TQueryKey, InfiniteData<TQueryFnData>>;
|
|
342
340
|
};
|
|
@@ -375,8 +373,6 @@ export { matchQuery }
|
|
|
375
373
|
|
|
376
374
|
declare type MAXIMUM_DEPTH = 20;
|
|
377
375
|
|
|
378
|
-
export declare function mockOnlineManagerIsOnline(value: boolean): MockInstance<() => boolean>;
|
|
379
|
-
|
|
380
376
|
export { MutateFunction }
|
|
381
377
|
|
|
382
378
|
export { MutateOptions }
|
|
@@ -413,11 +409,14 @@ export { MutationObserverResult }
|
|
|
413
409
|
|
|
414
410
|
export { MutationObserverSuccessResult }
|
|
415
411
|
|
|
412
|
+
declare interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
413
|
+
}
|
|
416
414
|
export { MutationOptions }
|
|
415
|
+
export { MutationOptions as MutationOptions_alias_1 }
|
|
417
416
|
|
|
418
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<
|
|
417
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
419
418
|
|
|
420
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<
|
|
419
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
421
420
|
export { mutationOptions }
|
|
422
421
|
export { mutationOptions as mutationOptions_alias_1 }
|
|
423
422
|
|
|
@@ -434,8 +433,6 @@ export { MutationStatus }
|
|
|
434
433
|
|
|
435
434
|
export { NetworkMode }
|
|
436
435
|
|
|
437
|
-
export { NoInfer_2 as NoInfer }
|
|
438
|
-
|
|
439
436
|
export { NonUndefinedGuard }
|
|
440
437
|
|
|
441
438
|
export { noop }
|
|
@@ -494,6 +491,8 @@ GetResults<Head>
|
|
|
494
491
|
|
|
495
492
|
export { Query }
|
|
496
493
|
|
|
494
|
+
export { QueryBooleanOption }
|
|
495
|
+
|
|
497
496
|
export { QueryCache }
|
|
498
497
|
|
|
499
498
|
export { QueryCacheNotifyEvent }
|
|
@@ -567,7 +566,10 @@ export { QueryObserverResult }
|
|
|
567
566
|
|
|
568
567
|
export { QueryObserverSuccessResult }
|
|
569
568
|
|
|
569
|
+
declare interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
570
|
+
}
|
|
570
571
|
export { QueryOptions }
|
|
572
|
+
export { QueryOptions as QueryOptions_alias_1 }
|
|
571
573
|
|
|
572
574
|
declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>>): ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>> & {
|
|
573
575
|
queryKey: DataTag<TQueryKey, TQueryFnData, TError>;
|
|
@@ -597,8 +599,6 @@ export { ResetOptions }
|
|
|
597
599
|
|
|
598
600
|
export { ResultOptions }
|
|
599
601
|
|
|
600
|
-
export declare function setActTimeout(fn: () => void, ms?: number): NodeJS.Timeout;
|
|
601
|
-
|
|
602
602
|
export { SetDataOptions }
|
|
603
603
|
|
|
604
604
|
export { shouldThrowError }
|
|
@@ -609,35 +609,6 @@ export { skipToken }
|
|
|
609
609
|
|
|
610
610
|
declare type SkipTokenForUseQueries = symbol;
|
|
611
611
|
|
|
612
|
-
declare interface SolidInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
613
|
-
queryKey: TQueryKey;
|
|
614
|
-
/**
|
|
615
|
-
* Only applicable while rendering queries on the server with streaming.
|
|
616
|
-
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
617
|
-
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
618
|
-
* Defaults to `false`.
|
|
619
|
-
*/
|
|
620
|
-
deferStream?: boolean;
|
|
621
|
-
/**
|
|
622
|
-
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
623
|
-
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
624
|
-
* Setting `suspense` to `false` will be a no-op.
|
|
625
|
-
*/
|
|
626
|
-
suspense?: boolean;
|
|
627
|
-
}
|
|
628
|
-
export { SolidInfiniteQueryOptions }
|
|
629
|
-
export { SolidInfiniteQueryOptions as SolidInfiniteQueryOptions_alias_1 }
|
|
630
|
-
|
|
631
|
-
declare interface SolidMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
632
|
-
}
|
|
633
|
-
export { SolidMutationOptions }
|
|
634
|
-
export { SolidMutationOptions as SolidMutationOptions_alias_1 }
|
|
635
|
-
|
|
636
|
-
declare interface SolidQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
637
|
-
}
|
|
638
|
-
export { SolidQueryOptions }
|
|
639
|
-
export { SolidQueryOptions as SolidQueryOptions_alias_1 }
|
|
640
|
-
|
|
641
612
|
export { StaleTime }
|
|
642
613
|
|
|
643
614
|
export { StaleTimeFunction }
|
|
@@ -650,13 +621,13 @@ export { timeoutManager }
|
|
|
650
621
|
|
|
651
622
|
export { TimeoutProvider }
|
|
652
623
|
|
|
653
|
-
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
624
|
+
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
654
625
|
initialData?: undefined;
|
|
655
626
|
}>;
|
|
656
627
|
export { UndefinedInitialDataInfiniteOptions }
|
|
657
628
|
export { UndefinedInitialDataInfiniteOptions as UndefinedInitialDataInfiniteOptions_alias_1 }
|
|
658
629
|
|
|
659
|
-
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
630
|
+
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
660
631
|
initialData?: undefined;
|
|
661
632
|
}>;
|
|
662
633
|
export { UndefinedInitialDataOptions }
|
|
@@ -709,7 +680,7 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
709
680
|
export { useInfiniteQuery }
|
|
710
681
|
export { useInfiniteQuery as useInfiniteQuery_alias_1 }
|
|
711
682
|
|
|
712
|
-
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
683
|
+
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>;
|
|
713
684
|
export { UseInfiniteQueryOptions as CreateInfiniteQueryOptions }
|
|
714
685
|
export { UseInfiniteQueryOptions }
|
|
715
686
|
export { UseInfiniteQueryOptions as UseInfiniteQueryOptions_alias_1 }
|
|
@@ -747,7 +718,7 @@ declare function useMutation<TData = unknown, TError = DefaultError, TVariables
|
|
|
747
718
|
export { useMutation }
|
|
748
719
|
export { useMutation as useMutation_alias_1 }
|
|
749
720
|
|
|
750
|
-
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<
|
|
721
|
+
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<MutationOptions<TData, TError, TVariables, TOnMutateResult>>;
|
|
751
722
|
export { UseMutationOptions as CreateMutationOptions }
|
|
752
723
|
export { UseMutationOptions }
|
|
753
724
|
export { UseMutationOptions as UseMutationOptions_alias_1 }
|
|
@@ -781,12 +752,12 @@ declare const useQueryClient: (queryClient?: QueryClient) => QueryClient;
|
|
|
781
752
|
export { useQueryClient }
|
|
782
753
|
export { useQueryClient as useQueryClient_alias_1 }
|
|
783
754
|
|
|
784
|
-
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
755
|
+
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey>>;
|
|
785
756
|
export { UseQueryOptions as CreateQueryOptions }
|
|
786
757
|
export { UseQueryOptions }
|
|
787
758
|
export { UseQueryOptions as UseQueryOptions_alias_1 }
|
|
788
759
|
|
|
789
|
-
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<
|
|
760
|
+
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<QueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'suspense'> & {
|
|
790
761
|
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;
|
|
791
762
|
/**
|
|
792
763
|
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
@@ -19,7 +19,6 @@ import { dehydrate } from '@tanstack/query-core';
|
|
|
19
19
|
import { DehydratedState } from '@tanstack/query-core';
|
|
20
20
|
import { DehydrateOptions } from '@tanstack/query-core';
|
|
21
21
|
import { DistributiveOmit } from '@tanstack/query-core';
|
|
22
|
-
import { Enabled } from '@tanstack/query-core';
|
|
23
22
|
import { EnsureInfiniteQueryDataOptions } from '@tanstack/query-core';
|
|
24
23
|
import { EnsureQueryDataOptions } from '@tanstack/query-core';
|
|
25
24
|
import { environmentManager } from '@tanstack/query-core';
|
|
@@ -55,12 +54,11 @@ import { InvalidateOptions } from '@tanstack/query-core';
|
|
|
55
54
|
import { InvalidateQueryFilters } from '@tanstack/query-core';
|
|
56
55
|
import { isCancelledError } from '@tanstack/query-core';
|
|
57
56
|
import { isServer } from '@tanstack/query-core';
|
|
58
|
-
import { JSX } from '
|
|
57
|
+
import type { JSX } from '@solidjs/web';
|
|
59
58
|
import { keepPreviousData } from '@tanstack/query-core';
|
|
60
59
|
import { ManagedTimerId } from '@tanstack/query-core';
|
|
61
60
|
import { matchMutation } from '@tanstack/query-core';
|
|
62
61
|
import { matchQuery } from '@tanstack/query-core';
|
|
63
|
-
import type { MockInstance } from 'vitest';
|
|
64
62
|
import { MutateFunction } from '@tanstack/query-core';
|
|
65
63
|
import { MutateOptions } from '@tanstack/query-core';
|
|
66
64
|
import { Mutation } from '@tanstack/query-core';
|
|
@@ -79,12 +77,10 @@ import { MutationObserverLoadingResult } from '@tanstack/query-core';
|
|
|
79
77
|
import { MutationObserverOptions } from '@tanstack/query-core';
|
|
80
78
|
import { MutationObserverResult } from '@tanstack/query-core';
|
|
81
79
|
import { MutationObserverSuccessResult } from '@tanstack/query-core';
|
|
82
|
-
import { MutationOptions } from '@tanstack/query-core';
|
|
83
80
|
import { MutationScope } from '@tanstack/query-core';
|
|
84
81
|
import { MutationState } from '@tanstack/query-core';
|
|
85
82
|
import { MutationStatus } from '@tanstack/query-core';
|
|
86
83
|
import { NetworkMode } from '@tanstack/query-core';
|
|
87
|
-
import { NoInfer as NoInfer_2 } from '@tanstack/query-core';
|
|
88
84
|
import { NonUndefinedGuard } from '@tanstack/query-core';
|
|
89
85
|
import { noop } from '@tanstack/query-core';
|
|
90
86
|
import { NotifyEvent } from '@tanstack/query-core';
|
|
@@ -93,15 +89,14 @@ import { notifyManager } from '@tanstack/query-core';
|
|
|
93
89
|
import { NotifyOnChangeProps } from '@tanstack/query-core';
|
|
94
90
|
import { OmitKeyof } from '@tanstack/query-core';
|
|
95
91
|
import { onlineManager } from '@tanstack/query-core';
|
|
96
|
-
import { Options } from 'tsup';
|
|
97
92
|
import { Override } from '@tanstack/query-core';
|
|
98
|
-
import type { ParentProps } from 'solid-js';
|
|
99
93
|
import { partialMatchKey } from '@tanstack/query-core';
|
|
100
94
|
import { PlaceholderDataFunction } from '@tanstack/query-core';
|
|
101
95
|
import { QueriesObserver } from '@tanstack/query-core';
|
|
102
96
|
import { QueriesObserverOptions } from '@tanstack/query-core';
|
|
103
97
|
import { QueriesPlaceholderDataFunction } from '@tanstack/query-core';
|
|
104
98
|
import { Query } from '@tanstack/query-core';
|
|
99
|
+
import { QueryBooleanOption } from '@tanstack/query-core';
|
|
105
100
|
import { QueryCache } from '@tanstack/query-core';
|
|
106
101
|
import { QueryCacheNotifyEvent } from '@tanstack/query-core';
|
|
107
102
|
import { QueryClient as QueryClient_2 } from '@tanstack/query-core';
|
|
@@ -122,7 +117,6 @@ import { QueryObserverPlaceholderResult } from '@tanstack/query-core';
|
|
|
122
117
|
import { QueryObserverRefetchErrorResult } from '@tanstack/query-core';
|
|
123
118
|
import { QueryObserverResult } from '@tanstack/query-core';
|
|
124
119
|
import { QueryObserverSuccessResult } from '@tanstack/query-core';
|
|
125
|
-
import { QueryOptions } from '@tanstack/query-core';
|
|
126
120
|
import { QueryPersister } from '@tanstack/query-core';
|
|
127
121
|
import { QueryState } from '@tanstack/query-core';
|
|
128
122
|
import { QueryStatus } from '@tanstack/query-core';
|
|
@@ -145,15 +139,10 @@ import { TimeoutProvider } from '@tanstack/query-core';
|
|
|
145
139
|
import { UnsetMarker } from '@tanstack/query-core';
|
|
146
140
|
import { unsetMarker } from '@tanstack/query-core';
|
|
147
141
|
import { Updater } from '@tanstack/query-core';
|
|
148
|
-
import { UserConfig } from 'vite';
|
|
149
142
|
import { WithRequired } from '@tanstack/query-core';
|
|
150
143
|
|
|
151
144
|
export { AnyDataTag }
|
|
152
145
|
|
|
153
|
-
export declare function Blink(props: {
|
|
154
|
-
duration: number;
|
|
155
|
-
} & ParentProps): JSX;
|
|
156
|
-
|
|
157
146
|
export { CancelledError }
|
|
158
147
|
|
|
159
148
|
export { CancelOptions }
|
|
@@ -172,14 +161,6 @@ export { dataTagErrorSymbol }
|
|
|
172
161
|
|
|
173
162
|
export { dataTagSymbol }
|
|
174
163
|
|
|
175
|
-
export declare const default_alias: any[];
|
|
176
|
-
|
|
177
|
-
export declare const default_alias_1: any[];
|
|
178
|
-
|
|
179
|
-
export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
180
|
-
|
|
181
|
-
export declare const default_alias_3: UserConfig;
|
|
182
|
-
|
|
183
164
|
export { DefaultedInfiniteQueryObserverOptions }
|
|
184
165
|
|
|
185
166
|
export { DefaultedQueryObserverOptions }
|
|
@@ -200,13 +181,13 @@ export { defaultShouldDehydrateQuery }
|
|
|
200
181
|
|
|
201
182
|
export { DefinedInfiniteQueryObserverResult }
|
|
202
183
|
|
|
203
|
-
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
184
|
+
declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
204
185
|
initialData: NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>> | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>);
|
|
205
186
|
}>;
|
|
206
187
|
export { DefinedInitialDataInfiniteOptions }
|
|
207
188
|
export { DefinedInitialDataInfiniteOptions as DefinedInitialDataInfiniteOptions_alias_1 }
|
|
208
189
|
|
|
209
|
-
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
190
|
+
declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
210
191
|
initialData: TQueryFnData | (() => TQueryFnData);
|
|
211
192
|
}>;
|
|
212
193
|
export { DefinedInitialDataOptions }
|
|
@@ -237,8 +218,6 @@ export { DehydrateOptions }
|
|
|
237
218
|
|
|
238
219
|
export { DistributiveOmit }
|
|
239
220
|
|
|
240
|
-
export { Enabled }
|
|
241
|
-
|
|
242
221
|
export { EnsureInfiniteQueryDataOptions }
|
|
243
222
|
|
|
244
223
|
export { EnsureQueryDataOptions }
|
|
@@ -337,6 +316,25 @@ export { InfiniteQueryObserverResult }
|
|
|
337
316
|
|
|
338
317
|
export { InfiniteQueryObserverSuccessResult }
|
|
339
318
|
|
|
319
|
+
declare interface InfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
320
|
+
queryKey: TQueryKey;
|
|
321
|
+
/**
|
|
322
|
+
* Only applicable while rendering queries on the server with streaming.
|
|
323
|
+
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
324
|
+
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
325
|
+
* Defaults to `false`.
|
|
326
|
+
*/
|
|
327
|
+
deferStream?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
330
|
+
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
331
|
+
* Setting `suspense` to `false` will be a no-op.
|
|
332
|
+
*/
|
|
333
|
+
suspense?: boolean;
|
|
334
|
+
}
|
|
335
|
+
export { InfiniteQueryOptions }
|
|
336
|
+
export { InfiniteQueryOptions as InfiniteQueryOptions_alias_1 }
|
|
337
|
+
|
|
340
338
|
declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>): ReturnType<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>> & {
|
|
341
339
|
queryKey: DataTag<TQueryKey, InfiniteData<TQueryFnData>>;
|
|
342
340
|
};
|
|
@@ -375,8 +373,6 @@ export { matchQuery }
|
|
|
375
373
|
|
|
376
374
|
declare type MAXIMUM_DEPTH = 20;
|
|
377
375
|
|
|
378
|
-
export declare function mockOnlineManagerIsOnline(value: boolean): MockInstance<() => boolean>;
|
|
379
|
-
|
|
380
376
|
export { MutateFunction }
|
|
381
377
|
|
|
382
378
|
export { MutateOptions }
|
|
@@ -413,11 +409,14 @@ export { MutationObserverResult }
|
|
|
413
409
|
|
|
414
410
|
export { MutationObserverSuccessResult }
|
|
415
411
|
|
|
412
|
+
declare interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
413
|
+
}
|
|
416
414
|
export { MutationOptions }
|
|
415
|
+
export { MutationOptions as MutationOptions_alias_1 }
|
|
417
416
|
|
|
418
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<
|
|
417
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): WithRequired<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
419
418
|
|
|
420
|
-
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<
|
|
419
|
+
declare function mutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>): Omit<MutationOptions<TData, TError, TVariables, TOnMutateResult>, 'mutationKey'>;
|
|
421
420
|
export { mutationOptions }
|
|
422
421
|
export { mutationOptions as mutationOptions_alias_1 }
|
|
423
422
|
|
|
@@ -434,8 +433,6 @@ export { MutationStatus }
|
|
|
434
433
|
|
|
435
434
|
export { NetworkMode }
|
|
436
435
|
|
|
437
|
-
export { NoInfer_2 as NoInfer }
|
|
438
|
-
|
|
439
436
|
export { NonUndefinedGuard }
|
|
440
437
|
|
|
441
438
|
export { noop }
|
|
@@ -494,6 +491,8 @@ GetResults<Head>
|
|
|
494
491
|
|
|
495
492
|
export { Query }
|
|
496
493
|
|
|
494
|
+
export { QueryBooleanOption }
|
|
495
|
+
|
|
497
496
|
export { QueryCache }
|
|
498
497
|
|
|
499
498
|
export { QueryCacheNotifyEvent }
|
|
@@ -567,7 +566,10 @@ export { QueryObserverResult }
|
|
|
567
566
|
|
|
568
567
|
export { QueryObserverSuccessResult }
|
|
569
568
|
|
|
569
|
+
declare interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
570
|
+
}
|
|
570
571
|
export { QueryOptions }
|
|
572
|
+
export { QueryOptions as QueryOptions_alias_1 }
|
|
571
573
|
|
|
572
574
|
declare function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>>): ReturnType<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>> & {
|
|
573
575
|
queryKey: DataTag<TQueryKey, TQueryFnData, TError>;
|
|
@@ -597,8 +599,6 @@ export { ResetOptions }
|
|
|
597
599
|
|
|
598
600
|
export { ResultOptions }
|
|
599
601
|
|
|
600
|
-
export declare function setActTimeout(fn: () => void, ms?: number): NodeJS.Timeout;
|
|
601
|
-
|
|
602
602
|
export { SetDataOptions }
|
|
603
603
|
|
|
604
604
|
export { shouldThrowError }
|
|
@@ -609,35 +609,6 @@ export { skipToken }
|
|
|
609
609
|
|
|
610
610
|
declare type SkipTokenForUseQueries = symbol;
|
|
611
611
|
|
|
612
|
-
declare interface SolidInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends OmitKeyof<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'queryKey' | 'suspense'> {
|
|
613
|
-
queryKey: TQueryKey;
|
|
614
|
-
/**
|
|
615
|
-
* Only applicable while rendering queries on the server with streaming.
|
|
616
|
-
* Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream.
|
|
617
|
-
* This can be useful to avoid sending a loading state to the client before the query has resolved.
|
|
618
|
-
* Defaults to `false`.
|
|
619
|
-
*/
|
|
620
|
-
deferStream?: boolean;
|
|
621
|
-
/**
|
|
622
|
-
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
|
623
|
-
* The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading.
|
|
624
|
-
* Setting `suspense` to `false` will be a no-op.
|
|
625
|
-
*/
|
|
626
|
-
suspense?: boolean;
|
|
627
|
-
}
|
|
628
|
-
export { SolidInfiniteQueryOptions }
|
|
629
|
-
export { SolidInfiniteQueryOptions as SolidInfiniteQueryOptions_alias_1 }
|
|
630
|
-
|
|
631
|
-
declare interface SolidMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends OmitKeyof<MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, '_defaulted'> {
|
|
632
|
-
}
|
|
633
|
-
export { SolidMutationOptions }
|
|
634
|
-
export { SolidMutationOptions as SolidMutationOptions_alias_1 }
|
|
635
|
-
|
|
636
|
-
declare interface SolidQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> {
|
|
637
|
-
}
|
|
638
|
-
export { SolidQueryOptions }
|
|
639
|
-
export { SolidQueryOptions as SolidQueryOptions_alias_1 }
|
|
640
|
-
|
|
641
612
|
export { StaleTime }
|
|
642
613
|
|
|
643
614
|
export { StaleTimeFunction }
|
|
@@ -650,13 +621,13 @@ export { timeoutManager }
|
|
|
650
621
|
|
|
651
622
|
export { TimeoutProvider }
|
|
652
623
|
|
|
653
|
-
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
624
|
+
declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
654
625
|
initialData?: undefined;
|
|
655
626
|
}>;
|
|
656
627
|
export { UndefinedInitialDataInfiniteOptions }
|
|
657
628
|
export { UndefinedInitialDataInfiniteOptions as UndefinedInitialDataInfiniteOptions_alias_1 }
|
|
658
629
|
|
|
659
|
-
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
630
|
+
declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
660
631
|
initialData?: undefined;
|
|
661
632
|
}>;
|
|
662
633
|
export { UndefinedInitialDataOptions }
|
|
@@ -709,7 +680,7 @@ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = I
|
|
|
709
680
|
export { useInfiniteQuery }
|
|
710
681
|
export { useInfiniteQuery as useInfiniteQuery_alias_1 }
|
|
711
682
|
|
|
712
|
-
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<
|
|
683
|
+
declare type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor<InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>;
|
|
713
684
|
export { UseInfiniteQueryOptions as CreateInfiniteQueryOptions }
|
|
714
685
|
export { UseInfiniteQueryOptions }
|
|
715
686
|
export { UseInfiniteQueryOptions as UseInfiniteQueryOptions_alias_1 }
|
|
@@ -747,7 +718,7 @@ declare function useMutation<TData = unknown, TError = DefaultError, TVariables
|
|
|
747
718
|
export { useMutation }
|
|
748
719
|
export { useMutation as useMutation_alias_1 }
|
|
749
720
|
|
|
750
|
-
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<
|
|
721
|
+
declare type UseMutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> = Accessor<MutationOptions<TData, TError, TVariables, TOnMutateResult>>;
|
|
751
722
|
export { UseMutationOptions as CreateMutationOptions }
|
|
752
723
|
export { UseMutationOptions }
|
|
753
724
|
export { UseMutationOptions as UseMutationOptions_alias_1 }
|
|
@@ -781,12 +752,12 @@ declare const useQueryClient: (queryClient?: QueryClient) => QueryClient;
|
|
|
781
752
|
export { useQueryClient }
|
|
782
753
|
export { useQueryClient as useQueryClient_alias_1 }
|
|
783
754
|
|
|
784
|
-
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<
|
|
755
|
+
declare type UseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey>>;
|
|
785
756
|
export { UseQueryOptions as CreateQueryOptions }
|
|
786
757
|
export { UseQueryOptions }
|
|
787
758
|
export { UseQueryOptions as UseQueryOptions_alias_1 }
|
|
788
759
|
|
|
789
|
-
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<
|
|
760
|
+
declare type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<QueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'suspense'> & {
|
|
790
761
|
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;
|
|
791
762
|
/**
|
|
792
763
|
* @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version.
|
package/build/dev.cjs
CHANGED
|
@@ -254,7 +254,10 @@ function useBaseQuery(options, Observer, queryClient) {
|
|
|
254
254
|
return Reflect.get(target, prop, receiver);
|
|
255
255
|
}
|
|
256
256
|
if (isServer) {
|
|
257
|
-
queryResource();
|
|
257
|
+
const resolved = queryResource();
|
|
258
|
+
if (prop in resolved) {
|
|
259
|
+
return Reflect.get(resolved, prop);
|
|
260
|
+
}
|
|
258
261
|
}
|
|
259
262
|
if (errorPassthroughProps.has(prop)) {
|
|
260
263
|
return Reflect.get(target, prop, receiver);
|
|
@@ -309,11 +312,13 @@ function useMutation(options, queryClient) {
|
|
|
309
312
|
mutateAsync: initialResult.mutate
|
|
310
313
|
});
|
|
311
314
|
const unsubscribe = observer.subscribe((result) => {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
solidJs.runWithOwner(null, () => {
|
|
316
|
+
setState(() => ({
|
|
317
|
+
...result,
|
|
318
|
+
mutate,
|
|
319
|
+
mutateAsync: result.mutate
|
|
320
|
+
}));
|
|
321
|
+
});
|
|
317
322
|
});
|
|
318
323
|
solidJs.onCleanup(unsubscribe);
|
|
319
324
|
solidJs.createRenderEffect(
|
package/build/dev.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.cjs';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.cjs';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
@@ -111,7 +111,6 @@ export { NonUndefinedGuard } from './_tsup-dts-rollup.cjs';
|
|
|
111
111
|
export { DistributiveOmit } from './_tsup-dts-rollup.cjs';
|
|
112
112
|
export { OmitKeyof } from './_tsup-dts-rollup.cjs';
|
|
113
113
|
export { Override } from './_tsup-dts-rollup.cjs';
|
|
114
|
-
export { NoInfer } from './_tsup-dts-rollup.cjs';
|
|
115
114
|
export { Register } from './_tsup-dts-rollup.cjs';
|
|
116
115
|
export { DefaultError } from './_tsup-dts-rollup.cjs';
|
|
117
116
|
export { QueryKey } from './_tsup-dts-rollup.cjs';
|
|
@@ -126,7 +125,7 @@ export { InferErrorFromTag } from './_tsup-dts-rollup.cjs';
|
|
|
126
125
|
export { QueryFunction } from './_tsup-dts-rollup.cjs';
|
|
127
126
|
export { StaleTime } from './_tsup-dts-rollup.cjs';
|
|
128
127
|
export { StaleTimeFunction } from './_tsup-dts-rollup.cjs';
|
|
129
|
-
export {
|
|
128
|
+
export { QueryBooleanOption } from './_tsup-dts-rollup.cjs';
|
|
130
129
|
export { QueryPersister } from './_tsup-dts-rollup.cjs';
|
|
131
130
|
export { QueryFunctionContext } from './_tsup-dts-rollup.cjs';
|
|
132
131
|
export { InitialDataFunction } from './_tsup-dts-rollup.cjs';
|
|
@@ -139,7 +138,6 @@ export { InfiniteData } from './_tsup-dts-rollup.cjs';
|
|
|
139
138
|
export { QueryMeta } from './_tsup-dts-rollup.cjs';
|
|
140
139
|
export { NetworkMode } from './_tsup-dts-rollup.cjs';
|
|
141
140
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.cjs';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
143
141
|
export { InitialPageParam } from './_tsup-dts-rollup.cjs';
|
|
144
142
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.cjs';
|
|
145
143
|
export { ThrowOnError } from './_tsup-dts-rollup.cjs';
|
|
@@ -184,7 +182,6 @@ export { MutationScope } from './_tsup-dts-rollup.cjs';
|
|
|
184
182
|
export { MutationMeta } from './_tsup-dts-rollup.cjs';
|
|
185
183
|
export { MutationFunctionContext } from './_tsup-dts-rollup.cjs';
|
|
186
184
|
export { MutationFunction } from './_tsup-dts-rollup.cjs';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
188
185
|
export { MutationObserverOptions } from './_tsup-dts-rollup.cjs';
|
|
189
186
|
export { MutateOptions } from './_tsup-dts-rollup.cjs';
|
|
190
187
|
export { MutateFunction } from './_tsup-dts-rollup.cjs';
|
package/build/dev.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.js';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.js';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.js';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.js';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.js';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
@@ -111,7 +111,6 @@ export { NonUndefinedGuard } from './_tsup-dts-rollup.js';
|
|
|
111
111
|
export { DistributiveOmit } from './_tsup-dts-rollup.js';
|
|
112
112
|
export { OmitKeyof } from './_tsup-dts-rollup.js';
|
|
113
113
|
export { Override } from './_tsup-dts-rollup.js';
|
|
114
|
-
export { NoInfer } from './_tsup-dts-rollup.js';
|
|
115
114
|
export { Register } from './_tsup-dts-rollup.js';
|
|
116
115
|
export { DefaultError } from './_tsup-dts-rollup.js';
|
|
117
116
|
export { QueryKey } from './_tsup-dts-rollup.js';
|
|
@@ -126,7 +125,7 @@ export { InferErrorFromTag } from './_tsup-dts-rollup.js';
|
|
|
126
125
|
export { QueryFunction } from './_tsup-dts-rollup.js';
|
|
127
126
|
export { StaleTime } from './_tsup-dts-rollup.js';
|
|
128
127
|
export { StaleTimeFunction } from './_tsup-dts-rollup.js';
|
|
129
|
-
export {
|
|
128
|
+
export { QueryBooleanOption } from './_tsup-dts-rollup.js';
|
|
130
129
|
export { QueryPersister } from './_tsup-dts-rollup.js';
|
|
131
130
|
export { QueryFunctionContext } from './_tsup-dts-rollup.js';
|
|
132
131
|
export { InitialDataFunction } from './_tsup-dts-rollup.js';
|
|
@@ -139,7 +138,6 @@ export { InfiniteData } from './_tsup-dts-rollup.js';
|
|
|
139
138
|
export { QueryMeta } from './_tsup-dts-rollup.js';
|
|
140
139
|
export { NetworkMode } from './_tsup-dts-rollup.js';
|
|
141
140
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.js';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
143
141
|
export { InitialPageParam } from './_tsup-dts-rollup.js';
|
|
144
142
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.js';
|
|
145
143
|
export { ThrowOnError } from './_tsup-dts-rollup.js';
|
|
@@ -184,7 +182,6 @@ export { MutationScope } from './_tsup-dts-rollup.js';
|
|
|
184
182
|
export { MutationMeta } from './_tsup-dts-rollup.js';
|
|
185
183
|
export { MutationFunctionContext } from './_tsup-dts-rollup.js';
|
|
186
184
|
export { MutationFunction } from './_tsup-dts-rollup.js';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
188
185
|
export { MutationObserverOptions } from './_tsup-dts-rollup.js';
|
|
189
186
|
export { MutateOptions } from './_tsup-dts-rollup.js';
|
|
190
187
|
export { MutateFunction } from './_tsup-dts-rollup.js';
|
package/build/dev.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MutationObserver, shouldThrowError, QueriesObserver, QueryClient as QueryClient$1, replaceEqualDeep, noop, notifyManager, QueryObserver, InfiniteQueryObserver } from '@tanstack/query-core';
|
|
2
2
|
export * from '@tanstack/query-core';
|
|
3
|
-
import { createContext, useContext, onCleanup, createMemo, untrack, createRenderEffect, createStore, merge, createEffect,
|
|
3
|
+
import { createContext, useContext, onCleanup, createMemo, untrack, createRenderEffect, createStore, runWithOwner, merge, createEffect, reconcile, createSignal, isPending, refresh, snapshot } from 'solid-js';
|
|
4
4
|
import { createComponent } from '@solidjs/web';
|
|
5
5
|
|
|
6
6
|
// src/useQuery.ts
|
|
@@ -253,7 +253,10 @@ function useBaseQuery(options, Observer, queryClient) {
|
|
|
253
253
|
return Reflect.get(target, prop, receiver);
|
|
254
254
|
}
|
|
255
255
|
if (isServer) {
|
|
256
|
-
queryResource();
|
|
256
|
+
const resolved = queryResource();
|
|
257
|
+
if (prop in resolved) {
|
|
258
|
+
return Reflect.get(resolved, prop);
|
|
259
|
+
}
|
|
257
260
|
}
|
|
258
261
|
if (errorPassthroughProps.has(prop)) {
|
|
259
262
|
return Reflect.get(target, prop, receiver);
|
|
@@ -308,11 +311,13 @@ function useMutation(options, queryClient) {
|
|
|
308
311
|
mutateAsync: initialResult.mutate
|
|
309
312
|
});
|
|
310
313
|
const unsubscribe = observer.subscribe((result) => {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
runWithOwner(null, () => {
|
|
315
|
+
setState(() => ({
|
|
316
|
+
...result,
|
|
317
|
+
mutate,
|
|
318
|
+
mutateAsync: result.mutate
|
|
319
|
+
}));
|
|
320
|
+
});
|
|
316
321
|
});
|
|
317
322
|
onCleanup(unsubscribe);
|
|
318
323
|
createRenderEffect(
|
package/build/index.cjs
CHANGED
|
@@ -245,7 +245,10 @@ function useBaseQuery(options, Observer, queryClient) {
|
|
|
245
245
|
return Reflect.get(target, prop, receiver);
|
|
246
246
|
}
|
|
247
247
|
if (isServer) {
|
|
248
|
-
queryResource();
|
|
248
|
+
const resolved = queryResource();
|
|
249
|
+
if (prop in resolved) {
|
|
250
|
+
return Reflect.get(resolved, prop);
|
|
251
|
+
}
|
|
249
252
|
}
|
|
250
253
|
if (errorPassthroughProps.has(prop)) {
|
|
251
254
|
return Reflect.get(target, prop, receiver);
|
|
@@ -300,11 +303,13 @@ function useMutation(options, queryClient) {
|
|
|
300
303
|
mutateAsync: initialResult.mutate
|
|
301
304
|
});
|
|
302
305
|
const unsubscribe = observer.subscribe((result) => {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
solidJs.runWithOwner(null, () => {
|
|
307
|
+
setState(() => ({
|
|
308
|
+
...result,
|
|
309
|
+
mutate,
|
|
310
|
+
mutateAsync: result.mutate
|
|
311
|
+
}));
|
|
312
|
+
});
|
|
308
313
|
});
|
|
309
314
|
solidJs.onCleanup(unsubscribe);
|
|
310
315
|
solidJs.createRenderEffect(
|
package/build/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.cjs';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.cjs';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.cjs';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.cjs';
|
|
@@ -111,7 +111,6 @@ export { NonUndefinedGuard } from './_tsup-dts-rollup.cjs';
|
|
|
111
111
|
export { DistributiveOmit } from './_tsup-dts-rollup.cjs';
|
|
112
112
|
export { OmitKeyof } from './_tsup-dts-rollup.cjs';
|
|
113
113
|
export { Override } from './_tsup-dts-rollup.cjs';
|
|
114
|
-
export { NoInfer } from './_tsup-dts-rollup.cjs';
|
|
115
114
|
export { Register } from './_tsup-dts-rollup.cjs';
|
|
116
115
|
export { DefaultError } from './_tsup-dts-rollup.cjs';
|
|
117
116
|
export { QueryKey } from './_tsup-dts-rollup.cjs';
|
|
@@ -126,7 +125,7 @@ export { InferErrorFromTag } from './_tsup-dts-rollup.cjs';
|
|
|
126
125
|
export { QueryFunction } from './_tsup-dts-rollup.cjs';
|
|
127
126
|
export { StaleTime } from './_tsup-dts-rollup.cjs';
|
|
128
127
|
export { StaleTimeFunction } from './_tsup-dts-rollup.cjs';
|
|
129
|
-
export {
|
|
128
|
+
export { QueryBooleanOption } from './_tsup-dts-rollup.cjs';
|
|
130
129
|
export { QueryPersister } from './_tsup-dts-rollup.cjs';
|
|
131
130
|
export { QueryFunctionContext } from './_tsup-dts-rollup.cjs';
|
|
132
131
|
export { InitialDataFunction } from './_tsup-dts-rollup.cjs';
|
|
@@ -139,7 +138,6 @@ export { InfiniteData } from './_tsup-dts-rollup.cjs';
|
|
|
139
138
|
export { QueryMeta } from './_tsup-dts-rollup.cjs';
|
|
140
139
|
export { NetworkMode } from './_tsup-dts-rollup.cjs';
|
|
141
140
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.cjs';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.cjs';
|
|
143
141
|
export { InitialPageParam } from './_tsup-dts-rollup.cjs';
|
|
144
142
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.cjs';
|
|
145
143
|
export { ThrowOnError } from './_tsup-dts-rollup.cjs';
|
|
@@ -184,7 +182,6 @@ export { MutationScope } from './_tsup-dts-rollup.cjs';
|
|
|
184
182
|
export { MutationMeta } from './_tsup-dts-rollup.cjs';
|
|
185
183
|
export { MutationFunctionContext } from './_tsup-dts-rollup.cjs';
|
|
186
184
|
export { MutationFunction } from './_tsup-dts-rollup.cjs';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.cjs';
|
|
188
185
|
export { MutationObserverOptions } from './_tsup-dts-rollup.cjs';
|
|
189
186
|
export { MutateOptions } from './_tsup-dts-rollup.cjs';
|
|
190
187
|
export { MutateFunction } from './_tsup-dts-rollup.cjs';
|
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { DefinedUseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
2
2
|
export { DefinedUseInfiniteQueryResult } from './_tsup-dts-rollup.js';
|
|
3
3
|
export { DefinedUseQueryResult } from './_tsup-dts-rollup.js';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export { InfiniteQueryOptions } from './_tsup-dts-rollup.js';
|
|
5
|
+
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
6
|
+
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
7
7
|
export { UseBaseMutationResult } from './_tsup-dts-rollup.js';
|
|
8
8
|
export { UseBaseQueryOptions } from './_tsup-dts-rollup.js';
|
|
9
9
|
export { UseBaseQueryResult } from './_tsup-dts-rollup.js';
|
|
@@ -111,7 +111,6 @@ export { NonUndefinedGuard } from './_tsup-dts-rollup.js';
|
|
|
111
111
|
export { DistributiveOmit } from './_tsup-dts-rollup.js';
|
|
112
112
|
export { OmitKeyof } from './_tsup-dts-rollup.js';
|
|
113
113
|
export { Override } from './_tsup-dts-rollup.js';
|
|
114
|
-
export { NoInfer } from './_tsup-dts-rollup.js';
|
|
115
114
|
export { Register } from './_tsup-dts-rollup.js';
|
|
116
115
|
export { DefaultError } from './_tsup-dts-rollup.js';
|
|
117
116
|
export { QueryKey } from './_tsup-dts-rollup.js';
|
|
@@ -126,7 +125,7 @@ export { InferErrorFromTag } from './_tsup-dts-rollup.js';
|
|
|
126
125
|
export { QueryFunction } from './_tsup-dts-rollup.js';
|
|
127
126
|
export { StaleTime } from './_tsup-dts-rollup.js';
|
|
128
127
|
export { StaleTimeFunction } from './_tsup-dts-rollup.js';
|
|
129
|
-
export {
|
|
128
|
+
export { QueryBooleanOption } from './_tsup-dts-rollup.js';
|
|
130
129
|
export { QueryPersister } from './_tsup-dts-rollup.js';
|
|
131
130
|
export { QueryFunctionContext } from './_tsup-dts-rollup.js';
|
|
132
131
|
export { InitialDataFunction } from './_tsup-dts-rollup.js';
|
|
@@ -139,7 +138,6 @@ export { InfiniteData } from './_tsup-dts-rollup.js';
|
|
|
139
138
|
export { QueryMeta } from './_tsup-dts-rollup.js';
|
|
140
139
|
export { NetworkMode } from './_tsup-dts-rollup.js';
|
|
141
140
|
export { NotifyOnChangeProps } from './_tsup-dts-rollup.js';
|
|
142
|
-
export { QueryOptions } from './_tsup-dts-rollup.js';
|
|
143
141
|
export { InitialPageParam } from './_tsup-dts-rollup.js';
|
|
144
142
|
export { InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.js';
|
|
145
143
|
export { ThrowOnError } from './_tsup-dts-rollup.js';
|
|
@@ -184,7 +182,6 @@ export { MutationScope } from './_tsup-dts-rollup.js';
|
|
|
184
182
|
export { MutationMeta } from './_tsup-dts-rollup.js';
|
|
185
183
|
export { MutationFunctionContext } from './_tsup-dts-rollup.js';
|
|
186
184
|
export { MutationFunction } from './_tsup-dts-rollup.js';
|
|
187
|
-
export { MutationOptions } from './_tsup-dts-rollup.js';
|
|
188
185
|
export { MutationObserverOptions } from './_tsup-dts-rollup.js';
|
|
189
186
|
export { MutateOptions } from './_tsup-dts-rollup.js';
|
|
190
187
|
export { MutateFunction } from './_tsup-dts-rollup.js';
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MutationObserver, shouldThrowError, QueriesObserver, QueryClient as QueryClient$1, replaceEqualDeep, noop, notifyManager, QueryObserver, InfiniteQueryObserver } from '@tanstack/query-core';
|
|
2
2
|
export * from '@tanstack/query-core';
|
|
3
|
-
import { createContext, useContext, onCleanup, createMemo, untrack, createRenderEffect, createStore, merge, createEffect,
|
|
3
|
+
import { createContext, useContext, onCleanup, createMemo, untrack, createRenderEffect, createStore, runWithOwner, merge, createEffect, reconcile, createSignal, isPending, refresh, snapshot } from 'solid-js';
|
|
4
4
|
import { createComponent } from '@solidjs/web';
|
|
5
5
|
|
|
6
6
|
// src/useQuery.ts
|
|
@@ -244,7 +244,10 @@ function useBaseQuery(options, Observer, queryClient) {
|
|
|
244
244
|
return Reflect.get(target, prop, receiver);
|
|
245
245
|
}
|
|
246
246
|
if (isServer) {
|
|
247
|
-
queryResource();
|
|
247
|
+
const resolved = queryResource();
|
|
248
|
+
if (prop in resolved) {
|
|
249
|
+
return Reflect.get(resolved, prop);
|
|
250
|
+
}
|
|
248
251
|
}
|
|
249
252
|
if (errorPassthroughProps.has(prop)) {
|
|
250
253
|
return Reflect.get(target, prop, receiver);
|
|
@@ -299,11 +302,13 @@ function useMutation(options, queryClient) {
|
|
|
299
302
|
mutateAsync: initialResult.mutate
|
|
300
303
|
});
|
|
301
304
|
const unsubscribe = observer.subscribe((result) => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
runWithOwner(null, () => {
|
|
306
|
+
setState(() => ({
|
|
307
|
+
...result,
|
|
308
|
+
mutate,
|
|
309
|
+
mutateAsync: result.mutate
|
|
310
|
+
}));
|
|
311
|
+
});
|
|
307
312
|
});
|
|
308
313
|
onCleanup(unsubscribe);
|
|
309
314
|
createRenderEffect(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.5",
|
|
4
4
|
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"!src/__tests__"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@tanstack/query-core": "5.
|
|
49
|
+
"@tanstack/query-core": "5.101.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@babel/core": "^7.28.0",
|
|
53
53
|
"@babel/preset-typescript": "^7.18.6",
|
|
54
54
|
"@solidjs/testing-library": "^0.8.10",
|
|
55
|
-
"@solidjs/web": "2.0.0-beta.
|
|
56
|
-
"babel-preset-solid": "2.0.0-beta.
|
|
55
|
+
"@solidjs/web": "2.0.0-beta.15",
|
|
56
|
+
"babel-preset-solid": "2.0.0-beta.15",
|
|
57
57
|
"npm-run-all2": "^5.0.0",
|
|
58
|
-
"solid-js": "2.0.0-beta.
|
|
58
|
+
"solid-js": "2.0.0-beta.15",
|
|
59
59
|
"tsup-preset-solid": "^2.2.0",
|
|
60
60
|
"vite-plugin-solid": "3.0.0-next.5",
|
|
61
61
|
"@tanstack/query-test-utils": "0.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, onCleanup, useContext } from 'solid-js'
|
|
2
2
|
import type { QueryClient } from './QueryClient'
|
|
3
|
-
import type { JSX } from '
|
|
3
|
+
import type { JSX } from '@solidjs/web'
|
|
4
4
|
|
|
5
5
|
export const QueryClientContext = createContext<(() => QueryClient) | null>(
|
|
6
6
|
null,
|
package/src/index.ts
CHANGED
|
@@ -15,9 +15,9 @@ export type {
|
|
|
15
15
|
DefinedUseBaseQueryResult,
|
|
16
16
|
DefinedUseInfiniteQueryResult,
|
|
17
17
|
DefinedUseQueryResult,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
InfiniteQueryOptions,
|
|
19
|
+
MutationOptions,
|
|
20
|
+
QueryOptions,
|
|
21
21
|
UseBaseMutationResult,
|
|
22
22
|
UseBaseQueryOptions,
|
|
23
23
|
UseBaseQueryResult,
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
NonUndefinedGuard,
|
|
6
6
|
QueryKey,
|
|
7
7
|
} from '@tanstack/query-core'
|
|
8
|
-
import type {
|
|
8
|
+
import type { InfiniteQueryOptions } from './types'
|
|
9
9
|
import type { Accessor } from 'solid-js'
|
|
10
10
|
|
|
11
11
|
export type UndefinedInitialDataInfiniteOptions<
|
|
@@ -15,13 +15,7 @@ export type UndefinedInitialDataInfiniteOptions<
|
|
|
15
15
|
TQueryKey extends QueryKey = QueryKey,
|
|
16
16
|
TPageParam = unknown,
|
|
17
17
|
> = Accessor<
|
|
18
|
-
|
|
19
|
-
TQueryFnData,
|
|
20
|
-
TError,
|
|
21
|
-
TData,
|
|
22
|
-
TQueryKey,
|
|
23
|
-
TPageParam
|
|
24
|
-
> & {
|
|
18
|
+
InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
25
19
|
initialData?: undefined
|
|
26
20
|
}
|
|
27
21
|
>
|
|
@@ -34,13 +28,7 @@ export type DefinedInitialDataInfiniteOptions<
|
|
|
34
28
|
TQueryKey extends QueryKey = QueryKey,
|
|
35
29
|
TPageParam = unknown,
|
|
36
30
|
> = Accessor<
|
|
37
|
-
|
|
38
|
-
TQueryFnData,
|
|
39
|
-
TError,
|
|
40
|
-
TData,
|
|
41
|
-
TQueryKey,
|
|
42
|
-
TPageParam
|
|
43
|
-
> & {
|
|
31
|
+
InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
|
|
44
32
|
initialData:
|
|
45
33
|
| NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>
|
|
46
34
|
| (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)
|
package/src/mutationOptions.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultError, WithRequired } from '@tanstack/query-core'
|
|
2
|
-
import type {
|
|
2
|
+
import type { MutationOptions } from './types'
|
|
3
3
|
|
|
4
4
|
export function mutationOptions<
|
|
5
5
|
TData = unknown,
|
|
@@ -8,11 +8,11 @@ export function mutationOptions<
|
|
|
8
8
|
TOnMutateResult = unknown,
|
|
9
9
|
>(
|
|
10
10
|
options: WithRequired<
|
|
11
|
-
|
|
11
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
12
12
|
'mutationKey'
|
|
13
13
|
>,
|
|
14
14
|
): WithRequired<
|
|
15
|
-
|
|
15
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
16
16
|
'mutationKey'
|
|
17
17
|
>
|
|
18
18
|
export function mutationOptions<
|
|
@@ -22,11 +22,11 @@ export function mutationOptions<
|
|
|
22
22
|
TOnMutateResult = unknown,
|
|
23
23
|
>(
|
|
24
24
|
options: Omit<
|
|
25
|
-
|
|
25
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
26
26
|
'mutationKey'
|
|
27
27
|
>,
|
|
28
28
|
): Omit<
|
|
29
|
-
|
|
29
|
+
MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
30
30
|
'mutationKey'
|
|
31
31
|
>
|
|
32
32
|
export function mutationOptions<
|
|
@@ -35,7 +35,7 @@ export function mutationOptions<
|
|
|
35
35
|
TVariables = void,
|
|
36
36
|
TOnMutateResult = unknown,
|
|
37
37
|
>(
|
|
38
|
-
options:
|
|
39
|
-
):
|
|
38
|
+
options: MutationOptions<TData, TError, TVariables, TOnMutateResult>,
|
|
39
|
+
): MutationOptions<TData, TError, TVariables, TOnMutateResult> {
|
|
40
40
|
return options
|
|
41
41
|
}
|
package/src/queryOptions.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataTag, DefaultError, QueryKey } from '@tanstack/query-core'
|
|
2
|
-
import type {
|
|
2
|
+
import type { QueryOptions } from './types'
|
|
3
3
|
import type { Accessor } from 'solid-js'
|
|
4
4
|
|
|
5
5
|
export type UndefinedInitialDataOptions<
|
|
@@ -8,7 +8,7 @@ export type UndefinedInitialDataOptions<
|
|
|
8
8
|
TData = TQueryFnData,
|
|
9
9
|
TQueryKey extends QueryKey = QueryKey,
|
|
10
10
|
> = Accessor<
|
|
11
|
-
|
|
11
|
+
QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
12
12
|
initialData?: undefined
|
|
13
13
|
}
|
|
14
14
|
>
|
|
@@ -19,7 +19,7 @@ export type DefinedInitialDataOptions<
|
|
|
19
19
|
TData = TQueryFnData,
|
|
20
20
|
TQueryKey extends QueryKey = QueryKey,
|
|
21
21
|
> = Accessor<
|
|
22
|
-
|
|
22
|
+
QueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
23
23
|
initialData: TQueryFnData | (() => TQueryFnData)
|
|
24
24
|
}
|
|
25
25
|
>
|
package/src/types.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface UseBaseQueryOptions<
|
|
|
44
44
|
suspense?: boolean
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export interface
|
|
47
|
+
export interface QueryOptions<
|
|
48
48
|
TQueryFnData = unknown,
|
|
49
49
|
TError = DefaultError,
|
|
50
50
|
TData = TQueryFnData,
|
|
@@ -62,7 +62,7 @@ export type UseQueryOptions<
|
|
|
62
62
|
TError = DefaultError,
|
|
63
63
|
TData = TQueryFnData,
|
|
64
64
|
TQueryKey extends QueryKey = QueryKey,
|
|
65
|
-
> = Accessor<
|
|
65
|
+
> = Accessor<QueryOptions<TQueryFnData, TError, TData, TQueryKey>>
|
|
66
66
|
|
|
67
67
|
/* --- Create Query and Create Base Query Types --- */
|
|
68
68
|
|
|
@@ -87,7 +87,7 @@ export type DefinedUseQueryResult<
|
|
|
87
87
|
> = DefinedUseBaseQueryResult<TData, TError>
|
|
88
88
|
|
|
89
89
|
/* --- Create Infinite Queries Types --- */
|
|
90
|
-
export interface
|
|
90
|
+
export interface InfiniteQueryOptions<
|
|
91
91
|
TQueryFnData = unknown,
|
|
92
92
|
TError = DefaultError,
|
|
93
93
|
TData = TQueryFnData,
|
|
@@ -126,7 +126,7 @@ export type UseInfiniteQueryOptions<
|
|
|
126
126
|
TQueryKey extends QueryKey = QueryKey,
|
|
127
127
|
TPageParam = unknown,
|
|
128
128
|
> = Accessor<
|
|
129
|
-
|
|
129
|
+
InfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>
|
|
130
130
|
>
|
|
131
131
|
|
|
132
132
|
export type UseInfiniteQueryResult<
|
|
@@ -140,7 +140,7 @@ export type DefinedUseInfiniteQueryResult<
|
|
|
140
140
|
> = DefinedInfiniteQueryObserverResult<TData, TError>
|
|
141
141
|
|
|
142
142
|
/* --- Create Mutation Types --- */
|
|
143
|
-
export interface
|
|
143
|
+
export interface MutationOptions<
|
|
144
144
|
TData = unknown,
|
|
145
145
|
TError = DefaultError,
|
|
146
146
|
TVariables = void,
|
|
@@ -155,7 +155,7 @@ export type UseMutationOptions<
|
|
|
155
155
|
TError = DefaultError,
|
|
156
156
|
TVariables = void,
|
|
157
157
|
TOnMutateResult = unknown,
|
|
158
|
-
> = Accessor<
|
|
158
|
+
> = Accessor<MutationOptions<TData, TError, TVariables, TOnMutateResult>>
|
|
159
159
|
|
|
160
160
|
export type UseMutateFunction<
|
|
161
161
|
TData = unknown,
|
package/src/useBaseQuery.ts
CHANGED
|
@@ -418,8 +418,19 @@ export function useBaseQuery<
|
|
|
418
418
|
// pending Promise, and re-renders with the resolved state. Without
|
|
419
419
|
// this, JSX reads through the Proxy never subscribe to queryResource
|
|
420
420
|
// and SSR HTML reflects the initial loading state.
|
|
421
|
+
//
|
|
422
|
+
// Read the value from the *resolved resource* rather than `state`. When
|
|
423
|
+
// the boundary suspends and re-renders after the query settles, the
|
|
424
|
+
// `state` store is not synced (the server subscriber resolves the
|
|
425
|
+
// resource Promise but does not write the store), so reading `state`
|
|
426
|
+
// would render stale loading values. Reading the resolved resource keeps
|
|
427
|
+
// the streamed SSR HTML consistent with the serialized resource, which
|
|
428
|
+
// is what the client hydrates against.
|
|
421
429
|
if (isServer) {
|
|
422
|
-
queryResource()
|
|
430
|
+
const resolved = queryResource()
|
|
431
|
+
if (prop in resolved) {
|
|
432
|
+
return Reflect.get(resolved, prop)
|
|
433
|
+
}
|
|
423
434
|
}
|
|
424
435
|
|
|
425
436
|
// Always pass through error-related props without throwing
|
package/src/useMutation.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
createRenderEffect,
|
|
5
5
|
createStore,
|
|
6
6
|
onCleanup,
|
|
7
|
+
runWithOwner,
|
|
7
8
|
untrack,
|
|
8
9
|
} from 'solid-js'
|
|
9
10
|
import { useQueryClient } from './QueryClientProvider'
|
|
@@ -63,11 +64,17 @@ export function useMutation<
|
|
|
63
64
|
})
|
|
64
65
|
|
|
65
66
|
const unsubscribe = observer.subscribe((result) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
// observer.mutate may be invoked synchronously from an owned scope (e.g.
|
|
68
|
+
// during render or inside an effect), which triggers this subscriber
|
|
69
|
+
// synchronously. Store writes inside an owned scope throw in Solid v2, so
|
|
70
|
+
// escape the owner to allow the setState write — matching useBaseQuery.
|
|
71
|
+
runWithOwner(null, () => {
|
|
72
|
+
setState(() => ({
|
|
73
|
+
...result,
|
|
74
|
+
mutate,
|
|
75
|
+
mutateAsync: result.mutate,
|
|
76
|
+
}))
|
|
77
|
+
})
|
|
71
78
|
})
|
|
72
79
|
|
|
73
80
|
onCleanup(unsubscribe)
|
package/src/useQueries.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from 'solid-js'
|
|
12
12
|
import { useQueryClient } from './QueryClientProvider'
|
|
13
13
|
import { useIsRestoring } from './isRestoring'
|
|
14
|
-
import type {
|
|
14
|
+
import type { QueryOptions, UseQueryResult } from './types'
|
|
15
15
|
import type { Accessor } from 'solid-js'
|
|
16
16
|
import type { QueryClient } from './QueryClient'
|
|
17
17
|
import type {
|
|
@@ -34,7 +34,7 @@ type UseQueryOptionsForUseQueries<
|
|
|
34
34
|
TData = TQueryFnData,
|
|
35
35
|
TQueryKey extends QueryKey = QueryKey,
|
|
36
36
|
> = OmitKeyof<
|
|
37
|
-
|
|
37
|
+
QueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
38
38
|
'placeholderData' | 'suspense'
|
|
39
39
|
> & {
|
|
40
40
|
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>
|