How to Run Apollo GraphQL in a QWIK Endpoint
Jul 9, 2023
Short version
- code Github
Long version
Highlights:
- starting with setting up QWIK and Apollo server
- we’ll add a couple of routes
- one to expose the GraphQL as an endpoint
- one to consume it
- in the endpoint we’ll use code inspired by the expressMiddlware for Apollo server 4 and update it so it works with the QWIK
RequestHandler
interface - on the consuming side
- fetch will need a slighly different URL when working on the server (SSR) vs the client so we’ll use the
onRequest
androuteLoader
to provide the URL from QWIK down to thegqlCall
function
Read more over at https://dev.to/gparlakov/how-to-run-apollo-graphql-in-a-qwik-endpoint-15p2