Skip to content

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

ParameterTypeDescription
appElysiaElysia application instance.
apolloServiceApolloServiceApollo service instance.
pathstringGraphQL 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');

Released under the MIT License.