diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index 5c0c7ed8cc..bc00bb243d 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -6,4 +6,10 @@ export { createLexer, TokenKind, Lexer } from './lexer'; export { parse, parseValue, parseType, ParseOptions } from './parser'; export { print } from './printer'; export { Source } from './source'; -export { visit, visitInParallel, visitWithTypeInfo, BREAK } from './visitor'; +export { + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK +} from './visitor'; diff --git a/types/graphql/language/visitor.d.ts b/types/graphql/language/visitor.d.ts index 024b292ed6..dc8bcc2692 100644 --- a/types/graphql/language/visitor.d.ts +++ b/types/graphql/language/visitor.d.ts @@ -47,3 +47,9 @@ export function visit(root: any, visitor: any, keyMap?: any): any; export function visitInParallel(visitors: any): any; export function visitWithTypeInfo(typeInfo: any, visitor: any): any; + +/** + * Given a visitor instance, if it is leaving or not, and a node kind, return + * the function the visitor runtime should call. + */ +export function getVisitFn(visitor: any, kind: any, isLeaving: any): any;