WO
Explore posts from serversHow to refetch data for a query when a mutation is performed in a different component?
To give a quick explanation of what I’m trying to do, I’m creating a system where a user can request to join a group and then the admins can accept or decline the request. I've tried following the docs for invalidating a single query but it seems to not be working in my case.
Component A is fetching the request status on the user side through a useQuery on one of my tRPC procedures.
Component A (checking request status on user side)
Component B performs a mutation (accept or decline) on the admin side from one of my tRPC procedures and I want it to immediately update the request status that the user sees in Component A after the admin accepts or declines.
Component B (declining the request on admin side)
10 replies