Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1import { Router, action, query } from '@solidjs/router';
2import { FileRoutes } from '@solidjs/start/router';
3import { Suspense } from 'solid-js';
4import {
5 createClient,
6 Provider,
7 cacheExchange,
8 fetchExchange,
9} from '@urql/solid-start';
10
11const client = createClient({
12 url: 'https://trygql.formidable.dev/graphql/basic-pokedex',
13 exchanges: [cacheExchange, fetchExchange],
14});
15
16export default function App() {
17 return (
18 <Router
19 root={props => (
20 <Provider value={{ client, query, action }}>
21 <Suspense>{props.children}</Suspense>
22 </Provider>
23 )}
24 >
25 <FileRoutes />
26 </Router>
27 );
28}