Skip to content

Commit

Permalink
fix(solid-query): Allow disabled queries to be SSR'd (#7300)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardeora committed Apr 18, 2024
1 parent 405135d commit 6e5a4a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/solid-query/src/createBaseQuery.ts
Expand Up @@ -74,6 +74,7 @@ const hydratableObserverResult = <
query: Query<TQueryFnData, TError, TData, TQueryKey>,
result: QueryObserverResult<TDataHydratable, TError>,
) => {
if (!isServer) return result
const obj: any = {
...unwrap(result),
// During SSR, functions cannot be serialized, so we need to remove them
Expand Down Expand Up @@ -255,7 +256,9 @@ export function createBaseQuery<
}
if (!observerResult.isLoading) {
resolver = null
return resolve(observerResult)
return resolve(
hydratableObserverResult(obs.getCurrentQuery(), observerResult),
)
}

setStateWithReconciliation(observerResult)
Expand Down

0 comments on commit 6e5a4a8

Please sign in to comment.