Skip to content
Source
Sign inSign up
TanStack/query

fix(solid-query): support combine functions returning any object shape #11239

Openwasaybuilds(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/11239/headopened View on GitHub

Showing 4 changed files with 160 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 0 deletions.changeset/solid-query-combine-result-shape.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-query': patch
+---
+​
+Fix `useQueries`/`createQueries` rejecting a `combine` function that returns a shape other than the results array, which previously failed to type check and threw `state.map is not a function` at runtime.
21 additions and 0 deletionspackages/solid-query/src/__tests__/useQueries.test-d.tsxModified
View file
@@ -296,6 +296,27 @@
}))
​
+ it('should allow combine to return a shape other than the results array', () => {
+ const result = useQueries(() => ({
+ queries: [
+ {
+ queryKey: queryKey(),
+ queryFn: () => Promise.resolve(1),
+ },
+ {
+ queryKey: queryKey(),
+ queryFn: () => Promise.resolve(2),
+ },
+ ],
+ combine: (results) => ({