Skip to content

Commit 1fa81c0

Browse files
committed
less clever
1 parent 4ba281e commit 1fa81c0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/validation/rules/MaxIntrospectionDepthRule.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ export function MaxIntrospectionDepthRule(
3232
(node.name.value === 'fields' ||
3333
node.name.value === 'interfaces' ||
3434
node.name.value === 'possibleTypes' ||
35-
node.name.value === 'inputFields') &&
36-
// eslint-disable-next-line no-param-reassign
37-
++depth >= MAX_LISTS_DEPTH
35+
node.name.value === 'inputFields')
3836
) {
39-
return true;
37+
// eslint-disable-next-line no-param-reassign
38+
depth++;
39+
if (depth >= MAX_LISTS_DEPTH) {
40+
return true;
41+
}
4042
}
4143

4244
// handles fields and inline fragments

0 commit comments

Comments
 (0)