Skip to content

Commit 89819b9

Browse files
committed
fix: don't return undefined, return skipToken instead
1 parent 5527c1b commit 89819b9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,12 @@ function createVueQueryProxyDecoration<TRouter extends AnyTRPCRouter>(
8585
const queryFn = computed<QueryFunction>(() => async ({ signal }) => {
8686
const input = toValue(_input)
8787

88-
const output =
89-
input === skipToken
90-
? undefined
91-
: await trpc.query(joinedPath, input, {
92-
signal,
93-
...trpcOptions,
94-
})
88+
if (input === skipToken) return skipToken
89+
90+
const output = await trpc.query(joinedPath, input, {
91+
signal,
92+
...trpcOptions,
93+
})
9594

9695
if (type === 'queries') return { output, input }
9796

0 commit comments

Comments
 (0)