@tanstack/solid-query 5.20.4 → 5.21.1

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/dev.cjs CHANGED
@@ -68,6 +68,10 @@ var hydratableObserverResult = (query, result) => {
68
68
  // cast to refetch function should be safe, since we only remove it on the server,
69
69
  // and refetch is not relevant on the server
70
70
  refetch: void 0,
71
+ // cast to fetchNextPage function should be safe, since we only remove it on the server,
72
+ fetchNextPage: void 0,
73
+ // cast to fetchPreviousPage function should be safe, since we only remove it on the server,
74
+ fetchPreviousPage: void 0,
71
75
  // hydrate() expects a QueryState object, which is similar but not
72
76
  // quite the same as a QueryObserverResult object. Thus, for now, we're
73
77
  // copying over the missing properties from state in order to support hydration
package/build/dev.js CHANGED
@@ -67,6 +67,10 @@ var hydratableObserverResult = (query, result) => {
67
67
  // cast to refetch function should be safe, since we only remove it on the server,
68
68
  // and refetch is not relevant on the server
69
69
  refetch: void 0,
70
+ // cast to fetchNextPage function should be safe, since we only remove it on the server,
71
+ fetchNextPage: void 0,
72
+ // cast to fetchPreviousPage function should be safe, since we only remove it on the server,
73
+ fetchPreviousPage: void 0,
70
74
  // hydrate() expects a QueryState object, which is similar but not
71
75
  // quite the same as a QueryObserverResult object. Thus, for now, we're
72
76
  // copying over the missing properties from state in order to support hydration
package/build/index.cjs CHANGED
@@ -68,6 +68,10 @@ var hydratableObserverResult = (query, result) => {
68
68
  // cast to refetch function should be safe, since we only remove it on the server,
69
69
  // and refetch is not relevant on the server
70
70
  refetch: void 0,
71
+ // cast to fetchNextPage function should be safe, since we only remove it on the server,
72
+ fetchNextPage: void 0,
73
+ // cast to fetchPreviousPage function should be safe, since we only remove it on the server,
74
+ fetchPreviousPage: void 0,
71
75
  // hydrate() expects a QueryState object, which is similar but not
72
76
  // quite the same as a QueryObserverResult object. Thus, for now, we're
73
77
  // copying over the missing properties from state in order to support hydration
package/build/index.js CHANGED
@@ -67,6 +67,10 @@ var hydratableObserverResult = (query, result) => {
67
67
  // cast to refetch function should be safe, since we only remove it on the server,
68
68
  // and refetch is not relevant on the server
69
69
  refetch: void 0,
70
+ // cast to fetchNextPage function should be safe, since we only remove it on the server,
71
+ fetchNextPage: void 0,
72
+ // cast to fetchPreviousPage function should be safe, since we only remove it on the server,
73
+ fetchPreviousPage: void 0,
70
74
  // hydrate() expects a QueryState object, which is similar but not
71
75
  // quite the same as a QueryObserverResult object. Thus, for now, we're
72
76
  // copying over the missing properties from state in order to support hydration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-query",
3
- "version": "5.20.4",
3
+ "version": "5.21.1",
4
4
  "description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "solid-js": "^1.8.14",
51
- "@tanstack/query-core": "5.20.4"
51
+ "@tanstack/query-core": "5.20.5"
52
52
  },
53
53
  "devDependencies": {
54
54
  "tsup-preset-solid": "^2.2.0",
@@ -22,6 +22,7 @@ import type { CreateBaseQueryOptions } from './types'
22
22
  import type { Accessor } from 'solid-js'
23
23
  import type { QueryClient } from './QueryClient'
24
24
  import type {
25
+ InfiniteQueryObserverResult,
25
26
  Query,
26
27
  QueryKey,
27
28
  QueryObserver,
@@ -47,7 +48,8 @@ function reconcileFn<TData, TError>(
47
48
  }
48
49
 
49
50
  type HydratableQueryState<TData, TError> = QueryObserverResult<TData, TError> &
50
- QueryState<TData, TError>
51
+ QueryState<TData, TError> &
52
+ InfiniteQueryObserverResult<TData, TError>
51
53
 
52
54
  /**
53
55
  * Solid's `onHydrated` functionality will silently "fail" (hydrate with an empty object)
@@ -62,7 +64,7 @@ const hydratableObserverResult = <
62
64
  >(
63
65
  query: Query<TQueryFnData, TError, TData, TQueryKey>,
64
66
  result: QueryObserverResult<TDataHydratable, TError>,
65
- ): HydratableQueryState<TDataHydratable, TError> => {
67
+ ) => {
66
68
  // Including the extra properties is only relevant on the server
67
69
  if (!isServer) return result as HydratableQueryState<TDataHydratable, TError>
68
70
 
@@ -76,6 +78,18 @@ const hydratableObserverResult = <
76
78
  TError
77
79
  >['refetch'],
78
80
 
81
+ // cast to fetchNextPage function should be safe, since we only remove it on the server,
82
+ fetchNextPage: undefined as unknown as HydratableQueryState<
83
+ TDataHydratable,
84
+ TError
85
+ >['fetchNextPage'],
86
+
87
+ // cast to fetchPreviousPage function should be safe, since we only remove it on the server,
88
+ fetchPreviousPage: undefined as unknown as HydratableQueryState<
89
+ TDataHydratable,
90
+ TError
91
+ >['fetchPreviousPage'],
92
+
79
93
  // hydrate() expects a QueryState object, which is similar but not
80
94
  // quite the same as a QueryObserverResult object. Thus, for now, we're
81
95
  // copying over the missing properties from state in order to support hydration
@@ -86,7 +100,7 @@ const hydratableObserverResult = <
86
100
  // Unsetting these properties on the server since they might not be serializable
87
101
  fetchFailureReason: null,
88
102
  fetchMeta: null,
89
- }
103
+ } as HydratableQueryState<TDataHydratable, TError>
90
104
  }
91
105
 
92
106
  // Base Query Function that is used to create the query.