Next.js Discord

Discord Forum

Can we use revalidateTag with Supabase

Unanswered
Afghan Hound posted this in #help-forum
Open in Discord
Afghan HoundOP
I've got a server action updating my database. AFter it's done, I'd like to revalidate the query so I can show the latest updated data. revalidateTag seems like it would be the best option but I can't quite figure out how to add a tag to my supabase query. Like in this stripped down version, how can i add a tag?
const { data, error: } = await supabaseClient
                    .from('Users')
                    .select('*') 
                    .eq('uid', fb_uid);
                if (error) {
                    throw error;
                }

7 Replies

@joulev you can use `unstable_cache` tsx const getData = unstable_cache( async (...) => {...}, [], { tags: ["hello"] } ) await getData(...)
English Spot
Hi do you know by any chance how to use revalidatePath with supabase as well? Because my data is not revalidated after calling revalidatePath in a server action
Sorry for the intrusion, and thanks in advance
English Spot
It's not working for me and idk why 😓
Do you mind taking a look at my code?
English Spot