1 | import { GraphQLSchema, DocumentNode } from 'graphql';
|
2 | import { SchemaDirectiveVisitor, IResolvers, IMocks, GraphQLParseOptions } from 'graphql-tools';
|
3 | import { ApolloConfig, ValueOrPromise, GraphQLExecutor, GraphQLExecutionResult, GraphQLRequestContextExecutionDidStart, ApolloConfigInput } from 'apollo-server-types';
|
4 | import { ConnectionContext } from 'subscriptions-transport-ws';
|
5 | import type WebSocket from 'ws';
|
6 | import { GraphQLExtension } from 'graphql-extensions';
|
7 | export { GraphQLExtension } from 'graphql-extensions';
|
8 | import { PlaygroundConfig } from './playground';
|
9 | export { PlaygroundConfig, PlaygroundRenderPageOptions } from './playground';
|
10 | import { GraphQLServerOptions as GraphQLOptions, PersistedQueryOptions } from './graphqlOptions';
|
11 | import { CacheControlExtensionOptions } from 'apollo-cache-control';
|
12 | import { ApolloServerPlugin } from 'apollo-server-plugin-base';
|
13 | import { GraphQLSchemaModule } from '@apollographql/apollo-tools';
|
14 | import type { EngineReportingOptions } from './plugin';
|
15 | export { GraphQLSchemaModule };
|
16 | export { KeyValueCache } from 'apollo-server-caching';
|
17 | export declare type Context<T = object> = T;
|
18 | export declare type ContextFunction<FunctionParams = any, ProducedContext = object> = (context: FunctionParams) => ValueOrPromise<Context<ProducedContext>>;
|
19 | export declare type PluginDefinition = ApolloServerPlugin | (() => ApolloServerPlugin);
|
20 | export interface SubscriptionServerOptions {
|
21 | path: string;
|
22 | keepAlive?: number;
|
23 | onConnect?: (connectionParams: Object, websocket: WebSocket, context: ConnectionContext) => any;
|
24 | onDisconnect?: (websocket: WebSocket, context: ConnectionContext) => any;
|
25 | }
|
26 | declare type BaseConfig = Pick<GraphQLOptions<Context>, 'formatError' | 'debug' | 'rootValue' | 'validationRules' | 'executor' | 'formatResponse' | 'fieldResolver' | 'tracing' | 'dataSources' | 'cache' | 'logger'>;
|
27 | export declare type Unsubscriber = () => void;
|
28 | export declare type SchemaChangeCallback = (schema: GraphQLSchema) => void;
|
29 | export declare type GraphQLServiceConfig = {
|
30 | schema: GraphQLSchema;
|
31 | executor: GraphQLExecutor;
|
32 | };
|
33 | export declare type GraphQLServiceEngineConfig = {
|
34 | apiKeyHash: string;
|
35 | graphId: string;
|
36 | graphVariant?: string;
|
37 | };
|
38 | export interface GraphQLService {
|
39 | load(options: {
|
40 | apollo?: ApolloConfig;
|
41 | engine?: GraphQLServiceEngineConfig;
|
42 | }): Promise<GraphQLServiceConfig>;
|
43 | onSchemaChange(callback: SchemaChangeCallback): Unsubscriber;
|
44 | executor<TContext>(requestContext: GraphQLRequestContextExecutionDidStart<TContext>): ValueOrPromise<GraphQLExecutionResult>;
|
45 | stop?(): Promise<void>;
|
46 | }
|
47 | export interface Config extends BaseConfig {
|
48 | modules?: GraphQLSchemaModule[];
|
49 | typeDefs?: DocumentNode | Array<DocumentNode> | string | Array<string>;
|
50 | parseOptions?: GraphQLParseOptions;
|
51 | resolvers?: IResolvers | Array<IResolvers>;
|
52 | schema?: GraphQLSchema;
|
53 | schemaDirectives?: Record<string, typeof SchemaDirectiveVisitor>;
|
54 | context?: Context | ContextFunction;
|
55 | introspection?: boolean;
|
56 | mocks?: boolean | IMocks;
|
57 | mockEntireSchema?: boolean;
|
58 | extensions?: Array<() => GraphQLExtension>;
|
59 | cacheControl?: CacheControlExtensionOptions | boolean;
|
60 | plugins?: PluginDefinition[];
|
61 | persistedQueries?: PersistedQueryOptions | false;
|
62 | subscriptions?: Partial<SubscriptionServerOptions> | string | false;
|
63 | uploads?: boolean | FileUploadOptions;
|
64 | playground?: PlaygroundConfig;
|
65 | gateway?: GraphQLService;
|
66 | experimental_approximateDocumentStoreMiB?: number;
|
67 | stopOnTerminationSignals?: boolean;
|
68 | apollo?: ApolloConfigInput;
|
69 | engine?: boolean | EngineReportingOptions<Context>;
|
70 | }
|
71 | export interface FileUploadOptions {
|
72 | maxFieldSize?: number;
|
73 | maxFileSize?: number;
|
74 | maxFiles?: number;
|
75 | }
|
76 |
|
\ | No newline at end of file |