From 90def5a50f1f51b54634295a6b4b4b2bec5ffe2f Mon Sep 17 00:00:00 2001 From: Iha Shin Date: Fri, 13 Sep 2024 15:37:31 -0700 Subject: [PATCH] fix(solid): Correctly track query data reads with suspense --- .changeset/healthy-years-ring.md | 5 +++++ packages/solid-urql/src/createQuery.ts | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .changeset/healthy-years-ring.md diff --git a/.changeset/healthy-years-ring.md b/.changeset/healthy-years-ring.md new file mode 100644 index 0000000000..3914f7f089 --- /dev/null +++ b/.changeset/healthy-years-ring.md @@ -0,0 +1,5 @@ +--- +'@urql/solid': patch +--- + +fix(solid): Correctly track query data reads with suspense diff --git a/packages/solid-urql/src/createQuery.ts b/packages/solid-urql/src/createQuery.ts index 2353462d46..29760cb0c9 100644 --- a/packages/solid-urql/src/createQuery.ts +++ b/packages/solid-urql/src/createQuery.ts @@ -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);