Plugin for elysia for using GraphQL Apollo.
Install with:
Then use it:
Accessing /graphql
should show Apollo GraphQL playground work with.
Because Elysia is based on Web Standard Request and Response which is different from Node's HttpRequest
and HttpResponse
that Express use, result in req, res
being undefined in context.
Because of this, Elysia replace both with context
like route parameter.
This plugin extends Apollo's ServerRegistration (which is ApolloServer
's' constructor parameter).
Below are the extended parameters for configuring Apollo Server with Elysia.
@default "/graphql"
Path to expose Apollo Server.
@default "process.env.ENV !== 'production'
Determine whether should Apollo should provide Apollo Playground.