Query keys
Hi! I'm super new to TRPC and based on my understanding, TRPC has a thin wrapper around react query. So, I'm wondering how to include the query keys when using trpc.
Thank you!
7 Replies
we do the query keys for you
the above becomes
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
is not necessary, just add the params. The queryKey is made for you.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Thank you! Just to clarify, if i wanted to invalidate the queries, I would do this?
useContext | tRPC
useContext is a hook that gives you access to helpers that let you manage the cached data of the queries you execute via @trpc/react-query. These helpers are actually thin wrappers around @tanstack/react-query's queryClient methods. If you want more in-depth information about options and usage patterns for useContext helpers than what we provide...
Oh.. totally missed this part of the docs! Thanks so much!