supabase-cache-helpers
supabase-cache-helpers copied to clipboard
Is it possible to use the global SWR mutate with RPC?
Hey @psteinroe , hope you're well! Quick question, is it possible to use the global mutate() on an RPC? For example, mutate('rpc/people_list_query')? It didn't seem to work for me but I could be doing something wrong.
I also tried with:
const { mutate } = useSWRConfig();
mutate('rpc/people_list_query')
Thanks in advance!
Hey! This should work via custom cache updates. For your case, useRevalidateTables('rpc/my_rpc') should do what you expect.
https://supabase-cache-helpers.vercel.app/postgrest/custom-cache-updates#userevalidatetables