1 | import type { GraphQLError, DocumentNode } from 'graphql';
|
2 | import type { GraphQLRequestContextDidResolveOperation, GraphQLRequestContext, GraphQLRequestContextWillSendResponse } from 'apollo-server-types';
|
3 | import type { Logger } from '@apollo/utils.logger';
|
4 | import type { fetch, RequestAgent } from 'apollo-server-env';
|
5 | import type { Trace } from 'apollo-reporting-protobuf';
|
6 | export interface ApolloServerPluginUsageReportingOptions<TContext> {
|
7 | sendVariableValues?: VariableValueOptions;
|
8 | sendHeaders?: SendValuesBaseOptions;
|
9 | rewriteError?: (err: GraphQLError) => GraphQLError | null;
|
10 | fieldLevelInstrumentation?: number | ((request: GraphQLRequestContextDidResolveOperation<TContext>) => Promise<number | boolean>);
|
11 | includeRequest?: (request: GraphQLRequestContextDidResolveOperation<TContext> | GraphQLRequestContextWillSendResponse<TContext>) => Promise<boolean>;
|
12 | generateClientInfo?: GenerateClientInfo<TContext>;
|
13 | overrideReportedSchema?: string;
|
14 | sendUnexecutableOperationDocuments?: boolean;
|
15 | experimental_sendOperationAsTrace?: (trace: Trace, statsReportKey: string) => boolean;
|
16 | sendReportsImmediately?: boolean;
|
17 | requestAgent?: RequestAgent | false;
|
18 | fetcher?: typeof fetch;
|
19 | reportIntervalMs?: number;
|
20 | maxUncompressedReportSize?: number;
|
21 | maxAttempts?: number;
|
22 | minimumRetryDelayMs?: number;
|
23 | requestTimeoutMs?: number;
|
24 | logger?: Logger;
|
25 | reportErrorFunction?: (err: Error) => void;
|
26 | endpointUrl?: string;
|
27 | debugPrintReports?: boolean;
|
28 | calculateSignature?: (ast: DocumentNode, operationName: string) => string;
|
29 | internal_includeTracesContributingToStats?: boolean;
|
30 | }
|
31 | export declare type SendValuesBaseOptions = {
|
32 | onlyNames: Array<String>;
|
33 | } | {
|
34 | exceptNames: Array<String>;
|
35 | } | {
|
36 | all: true;
|
37 | } | {
|
38 | none: true;
|
39 | };
|
40 | declare type VariableValueTransformOptions = {
|
41 | variables: Record<string, any>;
|
42 | operationString?: string;
|
43 | };
|
44 | export declare type VariableValueOptions = {
|
45 | transform: (options: VariableValueTransformOptions) => Record<string, any>;
|
46 | } | SendValuesBaseOptions;
|
47 | export interface ClientInfo {
|
48 | clientName?: string;
|
49 | clientVersion?: string;
|
50 | }
|
51 | export declare type GenerateClientInfo<TContext> = (requestContext: GraphQLRequestContext<TContext>) => ClientInfo;
|
52 | export {};
|
53 |
|
\ | No newline at end of file |