From 5aa31968f5e47c7919396f83fecaf5e4cf62d1ad Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Mon, 25 Sep 2023 09:19:22 -0700 Subject: [PATCH 1/2] fix jamie barton mappings conflict --- src/templates/videos.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/templates/videos.ts b/src/templates/videos.ts index c5f07aeb28..9d4a6358ea 100644 --- a/src/templates/videos.ts +++ b/src/templates/videos.ts @@ -292,10 +292,6 @@ export const videos = [ id: "IBMf4G7-xE8", title: `Miles Bardon - Improving the GraphQL developer experience on LEGO.com`, }, - { - id: "bmdWEydYas8", - title: `Jamie Barton - Unify Data Sources at the Edge with GraphQL`, - }, { id: "XX05BNMl7lo", title: `Darrell Warde - A journey through the GraphQL validation system`, From 4b6209b1604db74934c5fc93c497583baaa613e3 Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Mon, 25 Sep 2023 09:29:58 -0700 Subject: [PATCH 2/2] revert back from SSR to SSG --- src/templates/schedule.tsx | 44 +++----------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/src/templates/schedule.tsx b/src/templates/schedule.tsx index 34b67516c5..17b8246413 100644 --- a/src/templates/schedule.tsx +++ b/src/templates/schedule.tsx @@ -8,47 +8,9 @@ import ScheduleList, { ScheduleSession, } from "../components/Conf/Schedule/ScheduleList" -const fetchData = async (url: string) => { - try { - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - "User-Agent": "GraphQL Conf / GraphQL Foundation", - }, - }) - const data = await response.json() - return data - } catch (error: any) { - throw new Error( - `Error fetching data from ${url}: ${error.message || error.toString()}` - ) - } -} - -export async function getServerData() { - try { - const schedule: ScheduleSession[] = await fetchData( - `https://graphqlconf23.sched.com/api/session/list?api_key=${process.env.SCHED_ACCESS_TOKEN}&format=json` - ) - - return { - props: { - schedule, - }, - } - } catch (error) { - return { - status: 500, - headers: {}, - props: {}, - } - } -} - -const ScheduleTemplate: FC< - PageProps<{}, {}, {}, { schedule: ScheduleSession[] }> -> = ({ serverData: { schedule } }) => { +const ScheduleTemplate: FC> = ({ + pageContext: { schedule }, +}) => { return (