cache queries and revalidate with incremental static regeneration
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { VenueFragment } from "@/gql/graphql";
|
||||
import { getClient } from "@/app/client";
|
||||
import { cachedUntilOsloMidnight } from "@/lib/revalidation";
|
||||
import { EventContainer } from "@/components/events/EventContainer";
|
||||
import { PageHeader } from "@/components/general/PageHeader";
|
||||
import {
|
||||
@@ -17,7 +18,11 @@ export type EventIndexViewProps = {
|
||||
};
|
||||
|
||||
export async function loadEventIndexProps(): Promise<EventIndexViewProps> {
|
||||
const { data, error } = await getClient().query(eventsOverviewQuery, {});
|
||||
const { data, error } = await getClient().query(
|
||||
eventsOverviewQuery,
|
||||
{},
|
||||
cachedUntilOsloMidnight()
|
||||
);
|
||||
if (error) throw new Error(error.message);
|
||||
if (
|
||||
!data?.index ||
|
||||
|
||||
Reference in New Issue
Block a user