T
Join ServertRPC
❓-help
where is useQuery [key]?
Learning trpc, i use to tanstack with queryKey, can not find how that works with trpc, if i want to revalidate my query?
const query = useQuery({ queryKey: ['todos'], queryFn: getTodos })
Have you read the docs? https://trpc.io/docs/reactjs/introduction
We have a dedicated integration, which also has the ability to get query keys if you need (but we do it for you)
Yes, i have been reading the docs.
How do i invalidateQueries when i use
How do i invalidateQueries when i use
useMutation
? i don't know my queryKey name? Thank you.Solution
useContext https://trpc.io/docs/reactjs/usecontext