Pieter
Explore posts from serversQuery function depends on a variable
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.
7 replies