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
It would be nice to have the type of a procedure function. So not only the input or the output, but the function that is called by it. I needed it to create typesafe mock functions.
Describe the solution you'd like to see
I copied the GetInferenceHelpers and changed it a bit.
My workaround was to add this code into my own project.
But then I have these Imports from @trpc/server/src/unstable-core-do-not-import which is not the best practice.
So It would be nice, if you could just add the type.
Additional information
No response
👨👧👦 Contributing
🙋♂️ Yes, I'd be down to file a PR implementing this feature!
Funding
You can sponsor this specific effort via a Polar.sh pledge below
We receive the pledge once the issue is completed & verified
The text was updated successfully, but these errors were encountered:
There would be more type than actual code, which makes it a bit confusing. It quickly becomes a lot of types if you need to mock multiple routes. So I thought a extra type would be nice. If you add this to the original code it would be just about 6 extra lines, saving a lot of extra lines in the test files.
Therefore I would say, it is worth the tiny patch.
Describe the feature you'd like to request
It would be nice to have the type of a procedure function. So not only the input or the output, but the function that is called by it. I needed it to create typesafe mock functions.
Describe the solution you'd like to see
I copied the GetInferenceHelpers and changed it a bit.
Now I can use it for my AppRouter
And finally create some mocks:
which I can use for trpc-msw:
Describe alternate solutions
My workaround was to add this code into my own project.
But then I have these Imports from
@trpc/server/src/unstable-core-do-not-import
which is not the best practice.So It would be nice, if you could just add the type.
Additional information
No response
👨👧👦 Contributing
Funding
The text was updated successfully, but these errors were encountered: