Initial commit

This commit is contained in:
Bohdan Denysenko 2024-12-29 10:56:43 +00:00 • committed by GitHub
commit 864f37a652
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 45596 additions and 0 deletions

View file

@ -0,0 +1,41 @@
import { Text, Stack } from "@chakra-ui/react";
import { createLazyFileRoute } from "@tanstack/react-router";
import { gql, useQuery } from "@apollo/client";
export const Route = createLazyFileRoute("/")({
component: Index,
});
function Index() {
const { data } = useQuery(getBooksQuery);
return (
<Stack>
<Text>Hello world!</Text>
<Text>This is my template!</Text>
<Stack>
{data && (
<>
{data.booksMany.map((book: any) => (
<Stack key={book.id}>
<Text>{book.title}</Text>
<Text>{book.author}</Text>
</Stack>
))}
</>
)}
</Stack>
</Stack>
);
}
const getBooksQuery = gql`
query BooksMany {
booksMany {
id
author
title
}
}
`;