Query function depends on a variable

PPieter4/23/2023
In tRPC v10 accessing a specific path is really easy, but because of that I don't control the query key.

I'm using tRPC to fetch data based on user input in a search bar. Tanstack Query docs has a specific bit in the detailing that the variable should be included in the query key. What is the tRPC way of handeling this?
https://tanstack.com/query/latest/docs/react/guides/query-keys#if-your-query-function-depends-on-a-variable-include-it-in-your-query-key

Yes, I can use refetch with the query params in state but this is creating side-effects in my code that I would like to avoid.
Nnlucas4/23/2023
In tRPC the inputs to a query are both the query key and the inputs
Nnlucas4/23/2023
Could you give an example of the problem? I’m not sure how the state problem is different between vanilla RQ and tRPC RQ
PPieter4/23/2023
Ah alright, that makes sense then. I could not find that in the docs, is it in there somewhere?
Nnlucas4/23/2023
Yes