@tanstack/solid-query 5.28.13 → 5.29.3

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
@@ -132,7 +132,7 @@ function createBaseQuery(options, Observer, queryClient) {
132
132
  return obs.subscribe((result) => {
133
133
  queryCore.notifyManager.batchCalls(() => {
134
134
  const reconcileOptions = obs.options.reconcile;
135
- if (queryResource()?.data && result.data && !queryResource.loading) {
135
+ if (!queryResource.error && queryResource()?.data && result.data && !queryResource.loading) {
136
136
  setState((store) => {
137
137
  return reconcileFn(
138
138
  store,
@@ -203,7 +203,7 @@ function createBaseQuery(options, Observer, queryClient) {
203
203
  if (unsubscribe)
204
204
  return;
205
205
  const newOptions = { ...initialOptions };
206
- if (initialOptions.staleTime || !initialOptions.initialData) {
206
+ if ((initialOptions.staleTime || !initialOptions.initialData) && info.value) {
207
207
  newOptions.refetchOnMount = false;
208
208
  }
209
209
  observer().setOptions(newOptions);
package/build/dev.js CHANGED
@@ -131,7 +131,7 @@ function createBaseQuery(options, Observer, queryClient) {
131
131
  return obs.subscribe((result) => {
132
132
  notifyManager.batchCalls(() => {
133
133
  const reconcileOptions = obs.options.reconcile;
134
- if (queryResource()?.data && result.data && !queryResource.loading) {
134
+ if (!queryResource.error && queryResource()?.data && result.data && !queryResource.loading) {
135
135
  setState((store) => {
136
136
  return reconcileFn(
137
137
  store,
@@ -202,7 +202,7 @@ function createBaseQuery(options, Observer, queryClient) {
202
202
  if (unsubscribe)
203
203
  return;
204
204
  const newOptions = { ...initialOptions };
205
- if (initialOptions.staleTime || !initialOptions.initialData) {
205
+ if ((initialOptions.staleTime || !initialOptions.initialData) && info.value) {
206
206
  newOptions.refetchOnMount = false;
207
207
  }
208
208
  observer().setOptions(newOptions);
package/build/index.cjs CHANGED
@@ -132,7 +132,7 @@ function createBaseQuery(options, Observer, queryClient) {
132
132
  return obs.subscribe((result) => {
133
133
  queryCore.notifyManager.batchCalls(() => {
134
134
  const reconcileOptions = obs.options.reconcile;
135
- if (queryResource()?.data && result.data && !queryResource.loading) {
135
+ if (!queryResource.error && queryResource()?.data && result.data && !queryResource.loading) {
136
136
  setState((store) => {
137
137
  return reconcileFn(
138
138
  store,
@@ -203,7 +203,7 @@ function createBaseQuery(options, Observer, queryClient) {
203
203
  if (unsubscribe)
204
204
  return;
205
205
  const newOptions = { ...initialOptions };
206
- if (initialOptions.staleTime || !initialOptions.initialData) {
206
+ if ((initialOptions.staleTime || !initialOptions.initialData) && info.value) {
207
207
  newOptions.refetchOnMount = false;
208
208
  }
209
209
  observer().setOptions(newOptions);
package/build/index.js CHANGED
@@ -131,7 +131,7 @@ function createBaseQuery(options, Observer, queryClient) {
131
131
  return obs.subscribe((result) => {
132
132
  notifyManager.batchCalls(() => {
133
133
  const reconcileOptions = obs.options.reconcile;
134
- if (queryResource()?.data && result.data && !queryResource.loading) {
134
+ if (!queryResource.error && queryResource()?.data && result.data && !queryResource.loading) {
135
135
  setState((store) => {
136
136
  return reconcileFn(
137
137
  store,
@@ -202,7 +202,7 @@ function createBaseQuery(options, Observer, queryClient) {
202
202
  if (unsubscribe)
203
203
  return;
204
204
  const newOptions = { ...initialOptions };
205
- if (initialOptions.staleTime || !initialOptions.initialData) {
205
+ if ((initialOptions.staleTime || !initialOptions.initialData) && info.value) {
206
206
  newOptions.refetchOnMount = false;
207
207
  }
208
208
  observer().setOptions(newOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-query",
3
- "version": "5.28.13",
3
+ "version": "5.29.3",
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.28.13"
51
+ "@tanstack/query-core": "5.29.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "tsup-preset-solid": "^2.2.0",
@@ -187,7 +187,12 @@ export function createBaseQuery<
187
187
 
188
188
  // If the query has data we don't suspend but instead mutate the resource
189
189
  // This could happen when placeholderData/initialData is defined
190
- if (queryResource()?.data && result.data && !queryResource.loading) {
190
+ if (
191
+ !queryResource.error &&
192
+ queryResource()?.data &&
193
+ result.data &&
194
+ !queryResource.loading
195
+ ) {
191
196
  setState((store) => {
192
197
  return reconcileFn(
193
198
  store,
@@ -273,7 +278,10 @@ export function createBaseQuery<
273
278
  * even if `staleTime` is not set.
274
279
  */
275
280
  const newOptions = { ...initialOptions }
276
- if (initialOptions.staleTime || !initialOptions.initialData) {
281
+ if (
282
+ (initialOptions.staleTime || !initialOptions.initialData) &&
283
+ info.value
284
+ ) {
277
285
  newOptions.refetchOnMount = false
278
286
  }
279
287
  // Setting the options as an immutable object to prevent