I'm using rq with nextjs. I'm using the pages router and I'm having the following problem:
This is my query:
queryKey: ["classrooms"],
queryFn: () => {
if (!session?.accessToken || !session.apiEndpoint) {
return;
}
return apiClient.get(
"classrooms",
session.accessToken,
session.apiEndpoint
);
},
initialData: rosterData || [],
});```
rosterData is the data I pass to the page as a prop from getServerSideProps.
What happens is: If I navigate to the page using the router, everything works perfect, but if for some reason y reload the page using F5 for example, the query stops working and returns undefined.
Does anyone have insight in why is this happening?