From f9b6a5cc11025b7d0736e22f78f232ab7e5582a8 Mon Sep 17 00:00:00 2001 From: OrJDev Date: Sat, 5 Nov 2022 02:48:50 +0200 Subject: [PATCH] fix opts are not being passed --- package.json | 2 +- src/shared/proxy/decorationProxy.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4eba4ad..14e6c5a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "SolidJS tRPC", "author": "OrJDev", "license": "MIT", - "version": "0.0.4-rc.1", + "version": "0.0.5-rc.1", "publishConfig": { "access": "public", "tag": "next" diff --git a/src/shared/proxy/decorationProxy.ts b/src/shared/proxy/decorationProxy.ts index b3c456a..e9388a3 100644 --- a/src/shared/proxy/decorationProxy.ts +++ b/src/shared/proxy/decorationProxy.ts @@ -28,7 +28,13 @@ export function createSolidProxyDecoration< const [input, ...rest] = args; return (hooks as any)[lastArg]( () => getQueryKey(path, typeof input === "function" ? input() : input), - () => rest.map((arg) => (typeof arg === "function" ? arg() : arg)) + () => { + let p = {}; + for (const r of rest) { + p = { ...p, ...(typeof r === "function" ? r() : r) }; + } + return p; + } ); }); }