1 | import type { GraphQLSchema, DocumentNode, ParseOptions } from 'graphql';
|
2 | import type { IMocks } from '@graphql-tools/mock';
|
3 | import type { IResolvers } from '@graphql-tools/utils';
|
4 | import type { ApolloConfig, ValueOrPromise, GraphQLExecutor, ApolloConfigInput } from 'apollo-server-types';
|
5 | import type { GraphQLServerOptions as GraphQLOptions, PersistedQueryOptions } from './graphqlOptions';
|
6 | import type { ApolloServerPlugin } from 'apollo-server-plugin-base';
|
7 | import type { GraphQLSchemaModule } from '@apollographql/apollo-tools';
|
8 | export type { GraphQLSchemaModule };
|
9 | export { KeyValueCache } from 'apollo-server-caching';
|
10 | export declare type Context<T = object> = T;
|
11 | export declare type ContextFunction<FunctionParams = any, ProducedContext = object> = (context: FunctionParams) => ValueOrPromise<Context<ProducedContext>>;
|
12 | export declare type PluginDefinition = ApolloServerPlugin | (() => ApolloServerPlugin);
|
13 | declare type BaseConfig = Pick<GraphQLOptions<Context>, 'formatError' | 'debug' | 'rootValue' | 'validationRules' | 'executor' | 'formatResponse' | 'fieldResolver' | 'dataSources' | 'cache' | 'logger'>;
|
14 | export declare type Unsubscriber = () => void;
|
15 | export declare type SchemaChangeCallback = (apiSchema: GraphQLSchema) => void;
|
16 | export declare type GraphQLServiceConfig = {
|
17 | schema: GraphQLSchema;
|
18 | executor: GraphQLExecutor | null;
|
19 | };
|
20 | export interface GatewayInterface {
|
21 | load(options: {
|
22 | apollo: ApolloConfig;
|
23 | }): Promise<GraphQLServiceConfig>;
|
24 | onSchemaChange?(callback: SchemaChangeCallback): Unsubscriber;
|
25 | onSchemaLoadOrUpdate?(callback: (schemaContext: {
|
26 | apiSchema: GraphQLSchema;
|
27 | coreSupergraphSdl: string;
|
28 | }) => void): Unsubscriber;
|
29 | stop(): Promise<void>;
|
30 | }
|
31 | export interface GraphQLService extends GatewayInterface {
|
32 | }
|
33 | export interface Config<ContextFunctionParams = any> extends BaseConfig {
|
34 | modules?: GraphQLSchemaModule[];
|
35 | typeDefs?: DocumentNode | Array<DocumentNode> | string | Array<string>;
|
36 | parseOptions?: ParseOptions;
|
37 | resolvers?: IResolvers | Array<IResolvers>;
|
38 | schema?: GraphQLSchema;
|
39 | context?: Context | ContextFunction<ContextFunctionParams>;
|
40 | introspection?: boolean;
|
41 | mocks?: boolean | IMocks;
|
42 | mockEntireSchema?: boolean;
|
43 | plugins?: PluginDefinition[];
|
44 | persistedQueries?: PersistedQueryOptions | false;
|
45 | gateway?: GatewayInterface;
|
46 | experimental_approximateDocumentStoreMiB?: number;
|
47 | stopOnTerminationSignals?: boolean;
|
48 | apollo?: ApolloConfigInput;
|
49 | __testing_nodeEnv__?: string | undefined;
|
50 | }
|
51 |
|
\ | No newline at end of file |