Function: registerGraphQLRoutes()
ts
function registerGraphQLRoutes(
app,
apolloService,
path,
uploadOptions?
): void;Defined in: packages/apollo/src/graphql.controller.ts:60
Registers GraphQL HTTP routes on the Elysia application. Handles GET, POST, and OPTIONS requests for the GraphQL endpoint.
Parameters
| Parameter | Type | Description |
|---|---|---|
app | Elysia | Elysia application instance. |
apolloService | ApolloService | Apollo service instance. |
path | string | GraphQL endpoint path. |
uploadOptions? | UploadOptions | - |
Returns
void
Example
typescript
const app = new Elysia();
const apolloService = new ApolloService(options, app);
await apolloService.start();
registerGraphQLRoutes(app, apolloService, '/graphql');