import { Box, Button, Stack, Text } from '@chakra-ui/react' import { createFileRoute } from '@tanstack/react-router' import { gql, useQuery } from '@apollo/client' import { BooksManyQuery } from '@generated/types' export const Route = createFileRoute('/example')({ component: Dashboard, }) function Dashboard() { const { data, refetch } = useQuery(getBooksQuery) return ( Hello world! This is my template! {data && ( <> {data.booksMany.map((book: any) => ( {book.title} {book.author} ))} )} ) } const getBooksQuery = gql` query BooksMany { booksMany { id author title } } `