Skip to content

revert back from SSR to SSG #1578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 3 additions & 41 deletions src/templates/schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<PageProps<{}, { schedule: ScheduleSession[] }>> = ({
pageContext: { schedule },
}) => {
return (
<LayoutConf>
<HeaderConf className="shadow-none" />
Expand Down
4 changes: 0 additions & 4 deletions src/templates/videos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down