Skip to content

Commit

Permalink
fix(solid-query): Fix non hydrating queries (#5229)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardeora authored Apr 5, 2023
1 parent f4a97fa commit ffa6f67
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/solid-query/src/createBaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
})()
})
Expand Down

0 comments on commit ffa6f67

Please sign in to comment.