1 | import { GraphQLSchema, ValidationContext, GraphQLFieldResolver, DocumentNode, GraphQLError, GraphQLFormattedError, ParseOptions } from 'graphql';
|
2 | import { KeyValueCache, InMemoryLRUCache } from 'apollo-server-caching';
|
3 | import { DataSource } from 'apollo-datasource';
|
4 | import { ApolloServerPlugin } from 'apollo-server-plugin-base';
|
5 | import { GraphQLExecutor, ValueOrPromise, GraphQLResponse, GraphQLRequestContext, Logger, SchemaHash } from 'apollo-server-types';
|
6 | export interface GraphQLServerOptions<TContext = Record<string, any>, TRootValue = any> {
|
7 | schema: GraphQLSchema;
|
8 | schemaHash: SchemaHash;
|
9 | logger?: Logger;
|
10 | formatError?: (error: GraphQLError) => GraphQLFormattedError;
|
11 | rootValue?: ((parsedQuery: DocumentNode) => TRootValue) | TRootValue;
|
12 | context?: TContext | (() => never);
|
13 | validationRules?: Array<(context: ValidationContext) => any>;
|
14 | executor?: GraphQLExecutor;
|
15 | formatResponse?: (response: GraphQLResponse, requestContext: GraphQLRequestContext<TContext>) => GraphQLResponse | null;
|
16 | fieldResolver?: GraphQLFieldResolver<any, TContext>;
|
17 | debug?: boolean;
|
18 | dataSources?: () => DataSources<TContext>;
|
19 | cache?: KeyValueCache;
|
20 | persistedQueries?: PersistedQueryOptions;
|
21 | plugins?: ApolloServerPlugin[];
|
22 | documentStore?: InMemoryLRUCache<DocumentNode>;
|
23 | parseOptions?: ParseOptions;
|
24 | __testing_nodeEnv__?: string | undefined;
|
25 | }
|
26 | export declare type DataSources<TContext> = {
|
27 | [name: string]: DataSource<TContext>;
|
28 | };
|
29 | export interface PersistedQueryOptions {
|
30 | cache?: KeyValueCache;
|
31 | ttl?: number | null;
|
32 | }
|
33 | export default GraphQLServerOptions;
|
34 | export declare function resolveGraphqlOptions(options: GraphQLServerOptions | ((...args: Array<any>) => ValueOrPromise<GraphQLServerOptions>), ...args: Array<any>): Promise<GraphQLServerOptions>;
|
35 |
|
\ | No newline at end of file |