Integration with SvelteKit
SvelteKit is a framework for rapidly developing robust, performant web applications using Svelte.
SvelteKit is a framework for rapidly developing robust, performant web applications using Svelte. You can easily integrate Hive Gateway into your SvelteKit powered application.
Example
SvelteKit is typically used together with Vite with the project structure
looking like this. We also assume that you have
composed a supergraph.graphql with GraphQL Mesh.
In this example, we want to integrate Hive Gateway into Vite’s routes, we’ll therefore use the runtime.
Keeping the aforementioned project layout in mind,
create a new server route in my-project/src/routes/graphql/+server.ts to expose the GraphQL server
at /graphql and implement using the Hive Gateway runtime like this: