WunderGraph Svelte Query Integration
This package provides a type-safe integration of @tanstack/svelte-query with WunderGraph. Svelte Query is a data fetching library for Svelte apps. With simple utilities, you can significantly simplify the data fetching logic in your project. And it also covered in all aspects of speed, correctness, and stability to help you build better experiences.
Warning: Only works with WunderGraph.
Before you can use the utilities, you need to modify your code generation to include the base typescript client.
wunderctl generate to generate the code.
Now you can use the utility functions.
Now, in your svelte layout setup Svelte Query Provider such that it is always wrapping above the rest of the app.
Now you can use svelte-query to call your wundergraph operations!
If you are working with SvelteKit, this package provides
prefetchQuery utility to help with SSR
This implementation is based on TanStack Svelte Query's prefetchQuery approach
You can use all available options from Svelte Query with the generated functions. Due to the fact that we use the operationName + variables as key, you can't use the
key option as usual. In order to use conditional-fetching you can use the
You can configure the utilities globally by using the Svelte Query's QueryClient config.