Clients
Solid Query client
This package provides a type-safe integration of Solid Query with WunderGraph. Solid Query is a data fetching library for Solid.js.
Installation
1
Configuration
Before you can use the hooks, you need to modify your code generation to include the base typescript client.
1
2
3
4
5
6
7
8
9
10
11
Now you can configure the hooks. Create a new file, for example lib/wundergraph.ts
and add the following code:
1
2
3
4
5
6
7
In your App.tsx
add QueryClientProvider:
1
2
3
4
5
6
7
8
9
10
11
Usage
Now you can use the hooks in your components:
createQuery
1
2
3
4
createQuery (Live query)
1
2
3
4
5
createSubscription
1
2
3
4
5
6
createMutation
1
2
3
4
5
6
7
createFileUpload
1
2
3
4
5
6
useAuth
1
2
3
4
5
useUser
1
2
3
queryKey
You can use the queryKey
helper function to create a unique key for the query in a typesafe way. This is useful if you want to invalidate the query after mutating.
1
2
3
4
5
6
7
8
9
10
Options
You can use all available options from Solid Query .