import { print } from "graphql/language/printer"; import { ContentNode, Post } from "@/gql/graphql"; import { fetchGraphQL } from "@/utils/fetchGraphQL"; import styles from "./PostTemplate.module.css"; import { PostQuery } from "./PostQuery"; interface TemplateProps { node: ContentNode; } export default async function PostTemplate({ node }: TemplateProps) { const { post } = await fetchGraphQL<{ post: Post }>(print(PostQuery), { id: node.databaseId, }); return (

{post.title}

By {post.author?.node.name}
); }