diff --git a/packages/solid-query/src/createBaseQuery.ts b/packages/solid-query/src/createBaseQuery.ts index 2688e292a5..00dc80f78a 100644 --- a/packages/solid-query/src/createBaseQuery.ts +++ b/packages/solid-query/src/createBaseQuery.ts @@ -64,8 +64,9 @@ export function createBaseQuery< return observer.subscribe((result) => { notifyManager.batchCalls(() => { const query = observer.getCurrentQuery() + const { refetch, ...rest } = unwrap(result) const unwrappedResult = { - ...unwrap(result), + ...rest, // hydrate() expects a QueryState object, which is similar but not // quite the same as a QueryObserverResult object. Thus, for now, we're @@ -84,7 +85,9 @@ export function createBaseQuery< reject(unwrappedResult.error) } if (unwrappedResult.isSuccess) { - resolve(unwrappedResult) + // Use of any here is fine + // We cannot include refetch since it is not serializable + resolve(unwrappedResult as any) } })() })