Skip to content

Commit

Permalink
fix(solid): Correctly track query data reads with suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
XiNiHa committed Sep 13, 2024
1 parent b9f34fd commit 90def5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-years-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@urql/solid': patch
---

fix(solid): Correctly track query data reads with suspense
6 changes: 1 addition & 5 deletions packages/solid-urql/src/createQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,7 @@ export const createQuery = <
): any {
if (isSuspense() && prop === 'data') {
const resource = dataResource();
if (resource !== undefined) {
return resource.data;
}

return undefined;
if (resource === undefined) return undefined;
}

return Reflect.get(target, prop);
Expand Down

0 comments on commit 90def5a

Please sign in to comment.