import "./globals.css"; import Link from "next/link"; import { graphql } from "../gql"; import { grafbase } from "../lib/grafbase"; import type { Metadata } from "next"; export const revalidate = 0; export const metadata: Metadata = { title: "Grafbase + Next.js", description: "Grafbase + Next.js", }; const GetAllPostsDocument = graphql(/* GraphQL */ ` query GetAllPosts($first: Int!) { postCollection(first: $first) { edges { node { id title slug } } } } `); export default async function RootLayout({ children, }: { children: React.ReactNode; }) { const { postCollection } = await grafbase.request(GetAllPostsDocument, { first: 50, }); return (
{children}
); }