Skip to content

Commit 0e09439

Browse files
yaacovCRbenjie
andauthored
validation: align MaxIntrospectionDepthRule with v16 backport (#4583)
See prior PRs: - #4118 - #4119 Co-authored-by: Benjie <benjie@jemjie.com>
1 parent b32af06 commit 0e09439

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/validation/rules/MaxIntrospectionDepthRule.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import type { ASTNode } from '../../language/ast.js';
44
import { Kind } from '../../language/kinds.js';
55
import type { ASTVisitor } from '../../language/visitor.js';
66

7-
import type { ValidationContext } from '../ValidationContext.js';
7+
import type { ASTValidationContext } from '../ValidationContext.js';
88

99
const MAX_LISTS_DEPTH = 3;
1010

1111
export function MaxIntrospectionDepthRule(
12-
context: ValidationContext,
12+
context: ASTValidationContext,
1313
): ASTVisitor {
1414
/**
1515
* Counts the depth of list fields in "__Type" recursively and
@@ -30,7 +30,7 @@ export function MaxIntrospectionDepthRule(
3030
}
3131
const fragment = context.getFragment(fragmentName);
3232
if (!fragment) {
33-
// Missing fragments checks are handled by the `KnownFragmentNamesRule`.
33+
// Missing fragments checks are handled by `KnownFragmentNamesRule`.
3434
return false;
3535
}
3636

@@ -50,7 +50,6 @@ export function MaxIntrospectionDepthRule(
5050
if (
5151
node.kind === Kind.FIELD &&
5252
// check all introspection lists
53-
// TODO: instead of relying on field names, check whether the type is a list
5453
(node.name.value === 'fields' ||
5554
node.name.value === 'interfaces' ||
5655
node.name.value === 'possibleTypes' ||

0 commit comments

Comments
 (0)