web: start using graphql-codegen, switch to urql, use graphql data a few places
This commit is contained in:
@ -1,12 +1,25 @@
|
||||
import { graphql } from "@/gql";
|
||||
import {EventFragment} from "@/gql/graphql"
|
||||
import { getClient } from "@/app/client";
|
||||
import { EventList } from "@/components/events/EventList";
|
||||
import { Body } from "@/components/general/Body";
|
||||
import Image from "next/image";
|
||||
|
||||
export default function Home() {
|
||||
export default async function Home() {
|
||||
const homeQuery = graphql(`
|
||||
query home {
|
||||
events: pages(contentType: "events.EventPage") {
|
||||
...Event
|
||||
}
|
||||
}
|
||||
`);
|
||||
const { data, error } = await getClient().query(homeQuery, {});
|
||||
const events = (data?.events ?? []) as EventFragment[]
|
||||
|
||||
return (
|
||||
<main className="site-main" id="main">
|
||||
<div>
|
||||
<EventList />
|
||||
<EventList events={events} />
|
||||
<blockquote>«Hvor Glæden hersker, er alltid Fest»</blockquote>
|
||||
<p className="lead">
|
||||
Sed sodales nunc quis sapien malesuada, a faucibus turpis blandit.
|
||||
|
Reference in New Issue
Block a user