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);