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