UNPKG

973 BTypeScriptView Raw
1import type Koa from 'koa';
2import type { Middleware } from 'koa';
3import corsMiddleware from '@koa/cors';
4import bodyParser from 'koa-bodyparser';
5import { ApolloServerBase, GraphQLOptions } from 'apollo-server-core';
6export { GraphQLOptions } from 'apollo-server-core';
7export interface GetMiddlewareOptions {
8 path?: string;
9 cors?: corsMiddleware.Options | boolean;
10 bodyParserConfig?: bodyParser.Options | boolean;
11 onHealthCheck?: (ctx: Koa.Context) => Promise<any>;
12 disableHealthCheck?: boolean;
13}
14export interface ServerRegistration extends GetMiddlewareOptions {
15 app: Koa;
16}
17export declare class ApolloServer extends ApolloServerBase {
18 createGraphQLServerOptions(ctx: Koa.Context): Promise<GraphQLOptions>;
19 applyMiddleware({ app, ...rest }: ServerRegistration): void;
20 getMiddleware({ path, cors, bodyParserConfig, disableHealthCheck, onHealthCheck, }?: GetMiddlewareOptions): Middleware;
21}
22//# sourceMappingURL=ApolloServer.d.ts.map
\No newline at end of file