T
tRPC

How to refetch a call made on the server

How to refetch a call made on the server

Nnoahsolomon11/4/2023
const section = await api.course.getCourseSection.query({
sectionId: parseInt(params.lesson),
});
const section = await api.course.getCourseSection.query({
sectionId: parseInt(params.lesson),
});
I need to refetch this when some button is clicked (or if easier, when some query string param is changed), but this component NEEDS to be a server component unfortunately. How can I revalidate this tRPC call?
Nnoahsolomon11/4/2023
this is in the page.tsx which is a server component. When a child clicks a button and makes a post, I need the section to reinvoke this tRPC endpoint but idk how to do this if it's even possibke

Looking for more? Join the community!

T
tRPC

How to refetch a call made on the server

Join Server