Initial commit
This commit is contained in:
commit
864f37a652
48 changed files with 45596 additions and 0 deletions
41
app/client/pages/index.lazy.tsx
Normal file
41
app/client/pages/index.lazy.tsx
Normal 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
|
||||
}
|
||||
}
|
||||
`;
|
||||
Loading…
Add table
Add a link
Reference in a new issue