You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to occur when using httpBatchLink, when using httpLink this doesn't happen, and I also see you mention that batch is not supported in the README. Can be closed if no plans for this.
This seems to occur when using httpBatchLink, when using httpLink this doesn't happen, and I also see you mention that batch is not supported in the README. Can be closed if no plans for this.
I would like to support httpBatchLink at some point since I actually use it and it would help to have tests that are closer to the real world usage of tRPC so I'll leave this open for now.
Describe the bug
When mocking a query, and using
req.getInput
, TS incorrectly infers the type.To Reproduce
I've created an example repo to reproduce the bug:
https://github.com/DavidAmmeraal/msw-trpc-bug/blob/main/src/example.ts
Given the following:
TS tells me that
req.getInput
should be of type:However, when running the code (using
npx ts-node src/example.ts
), the return value is instead:Expected behavior
I would expect
getInput
to return a value of shape:Versions
"@trpc/next": "^10.37.1",
"@trpc/react-query": "^10.37.1",
"@trpc/server": "^10.37.1",
"typescript": "^5.1.3",
The text was updated successfully, but these errors were encountered: