import type { WithRequired } from '@apollo/utils.withrequired'; import type { Trace } from '@apollo/usage-reporting-protobuf'; import type { BaseContext } from './context.js'; import type { GraphQLInProgressResponse, GraphQLRequest, GraphQLResponse } from './graphql.js'; import type { Logger } from '@apollo/utils.logger'; import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; import type { DocumentNode, GraphQLError, GraphQLSchema, OperationDefinitionNode } from 'graphql'; import type { CachePolicy } from '@apollo/cache-control-types'; import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface'; export interface GraphQLRequestMetrics { captureTraces?: boolean; persistedQueryHit?: boolean; persistedQueryRegister?: boolean; responseCacheHit?: boolean; forbiddenOperation?: boolean; registeredOperation?: boolean; startHrTime?: [number, number]; queryPlanTrace?: Trace.QueryPlanNode; nonFtv1ErrorPaths?: NonFtv1ErrorPath[]; } export interface GraphQLRequestContext { readonly logger: Logger; readonly cache: KeyValueCache; readonly request: GraphQLRequest; readonly response: GraphQLInProgressResponse; readonly schema: GraphQLSchema; readonly contextValue: TContext; readonly queryHash?: string; readonly document?: DocumentNode; readonly source?: string; readonly operationName?: string | null; readonly operation?: OperationDefinitionNode; readonly errors?: ReadonlyArray; readonly metrics: GraphQLRequestMetrics; readonly overallCachePolicy: CachePolicy; readonly requestIsBatched: boolean; } export type GraphQLRequestContextDidResolveSource = WithRequired, 'source' | 'queryHash'>; export type GraphQLRequestContextParsingDidStart = GraphQLRequestContextDidResolveSource; export type GraphQLRequestContextValidationDidStart = GraphQLRequestContextParsingDidStart & WithRequired, 'document'>; export type GraphQLRequestContextDidResolveOperation = GraphQLRequestContextValidationDidStart & WithRequired, 'operationName'>; export type GraphQLRequestContextDidEncounterErrors = WithRequired, 'errors'>; export type GraphQLRequestContextResponseForOperation = WithRequired, 'source' | 'document' | 'operation' | 'operationName'>; export type GraphQLRequestContextExecutionDidStart = GraphQLRequestContextParsingDidStart & WithRequired, 'document' | 'operation' | 'operationName'>; export type GraphQLRequestContextWillSendResponse = GraphQLRequestContextDidResolveSource & { readonly response: GraphQLResponse; }; export type GraphQLRequestContextDidEncounterSubsequentErrors = GraphQLRequestContextWillSendResponse; export type GraphQLRequestContextWillSendSubsequentPayload = GraphQLRequestContextWillSendResponse; //# sourceMappingURL=requestPipeline.d.ts.map