Can we use revalidateTag with Supabase
Unanswered
Afghan Hound posted this in #help-forum
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
@Afghan Hound 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;
}
you can use
unstable_cacheconst getData = unstable_cache(
async (...) => {...},
[],
{ tags: ["hello"] }
)
await getData(...)@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 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
revalidatePath should work regardless of whether you use supabase or not
English Spot
It's not working for me and idk why 😓
Do you mind taking a look at my code?
Do you mind taking a look at my code?
@English Spot It's not working for me and idk why 😓
Do you mind taking a look at my code?
Please make a separate post
English Spot
I already made one!
https://nextjs-forum.com/post/1252491377988861964
https://nextjs-forum.com/post/1252491377988861964