1 | import express from 'express';
|
2 | import corsMiddleware from 'cors';
|
3 | import { OptionsJson } from 'body-parser';
|
4 | import { GraphQLOptions, ApolloServerBase, Config } from 'apollo-server-core';
|
5 | export { GraphQLOptions } from 'apollo-server-core';
|
6 | export interface GetMiddlewareOptions {
|
7 | path?: string;
|
8 | cors?: corsMiddleware.CorsOptions | corsMiddleware.CorsOptionsDelegate | boolean;
|
9 | bodyParserConfig?: OptionsJson | boolean;
|
10 | onHealthCheck?: (req: express.Request) => Promise<any>;
|
11 | disableHealthCheck?: boolean;
|
12 | }
|
13 | export interface ServerRegistration extends GetMiddlewareOptions {
|
14 | app: express.Application;
|
15 | }
|
16 | export interface ExpressContext {
|
17 | req: express.Request;
|
18 | res: express.Response;
|
19 | }
|
20 | export declare type ApolloServerExpressConfig = Config<ExpressContext>;
|
21 | export declare class ApolloServer<ContextFunctionParams = ExpressContext> extends ApolloServerBase<ContextFunctionParams> {
|
22 | createGraphQLServerOptions(req: express.Request, res: express.Response): Promise<GraphQLOptions>;
|
23 | applyMiddleware({ app, ...rest }: ServerRegistration): void;
|
24 | getMiddleware({ path, cors, bodyParserConfig, disableHealthCheck, onHealthCheck, }?: GetMiddlewareOptions): express.Router;
|
25 | }
|
26 |
|
\ | No newline at end of file |