WeezyEzo
is there a better way to do this?
your implementation is against the laws of hooks. Hooks should not be called conditionally. Instead, you can make use of the
enabled
option of react query.
I think this is the good way of doing what you want.
If you want to use only one variable for any of the data you can do this:
This issue is more of react-query
related rather than trpc
.3 replies
Ability to mutate/extend `input` from middlewares
So here is what i found. tldr: none of the functions are exported for external use.
There is a function called
createNewBuilder
It does what i want, but it is not exported for external use.
There are some other functions that could help (for example, createResolver
to create a custom reoslver with my middlewares applied), but I was not able to import them.20 replies
Ability to mutate/extend `input` from middlewares
I still think that mutating
input
is the responsibility of trpc
. A lot of web frameworks allow you to mutate the input passed. Trpc itself lets you extend the context
. Implementing it for input
would be convenient as well.20 replies