Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-lands-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/solid-query': patch
---

Skip errors if returned data is undefined
2 changes: 1 addition & 1 deletion packages/solid-query/src/useBaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function useBaseQuery<
const query = observer().getCurrentQuery()
const unwrappedResult = hydratableObserverResult(query, result)

if (unwrappedResult.isError) {
if (result.data !== undefined && unwrappedResult.isError) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only skips it for the server subscriber. I am not sure if there is a better heuristic here instead of just data is undefined

reject(unwrappedResult.error)
unsubscribeIfQueued()
} else {
Expand Down
Loading