web: fetch some content

This commit is contained in:
2024-05-07 04:05:40 +02:00
parent 3fdb4b92a2
commit 5b9c484f14
6 changed files with 394 additions and 12 deletions

View File

@ -0,0 +1,39 @@
import { gql } from "@apollo/client";
import { getClient } from "@/app/client";
export default async function Page() {
const query = gql(`
{
pages(contentType: "events.EventPage") {
id
slug
title
... on EventPage {
body {
id
blockType
}
}
}
}
`);
const { data } = await getClient().query({
query: query,
});
return (
<main className="site-main" id="main">
<section className="page-header textOnly">
<h1>Arrangementer</h1>
<p>woo</p>
</section>
{data.pages && (
<section className="page-content">
{data.pages.map((event) => (
<div key={event.id}>{event.title}</div>
))}
</section>
)}
</main>
);
}