UNPKG

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