implemented identity, updated session, added 'workings' list
added paginated querying, added 'common'
This commit is contained in:
parent
027deba422
commit
6ada519e06
36 changed files with 1422 additions and 279 deletions
46
app/client/pages/example.tsx
Normal file
46
app/client/pages/example.tsx
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
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<BooksManyQuery>(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>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
<Box>
|
||||
<Button onClick={async () => refetch()}>Refetch</Button>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Stack>
|
||||
)
|
||||
}
|
||||
|
||||
const getBooksQuery = gql`
|
||||
query BooksMany {
|
||||
booksMany {
|
||||
id
|
||||
author
|
||||
title
|
||||
}
|
||||
}
|
||||
`
|
||||
Loading…
Add table
Add a link
Reference in a new issue