1 | import { GraphQLError, GraphQLSchema } from 'graphql';
|
2 | import { ExecutionRequest, ExecutionResult } from './Interfaces.js';
|
3 | export type ValueVisitor = (value: any) => any;
|
4 | export type ObjectValueVisitor = {
|
5 | __enter?: ValueVisitor;
|
6 | __leave?: ValueVisitor;
|
7 | } & Record<string, ValueVisitor>;
|
8 | export type ResultVisitorMap = Record<string, ValueVisitor | ObjectValueVisitor>;
|
9 | export type ErrorVisitor = (error: GraphQLError, pathIndex: number) => GraphQLError;
|
10 | export type ErrorVisitorMap = {
|
11 | __unpathed?: (error: GraphQLError) => GraphQLError;
|
12 | } & Record<string, Record<string, ErrorVisitor>>;
|
13 | export declare function visitData(data: any, enter?: ValueVisitor, leave?: ValueVisitor): any;
|
14 | export declare function visitErrors(errors: ReadonlyArray<GraphQLError>, visitor: (error: GraphQLError) => GraphQLError): Array<GraphQLError>;
|
15 | export declare function visitResult(result: ExecutionResult, request: ExecutionRequest, schema: GraphQLSchema, resultVisitorMap?: ResultVisitorMap, errorVisitorMap?: ErrorVisitorMap): any;
|