Skip to content

Commit 572b51f

Browse files
committed
dont break, just dont visit further
1 parent 1fa81c0 commit 572b51f

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

src/validation/__tests__/MaxIntrospectionDepthRule-test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,24 @@ describe('Validate: Max introspection nodes rule', () => {
230230
},
231231
],
232232
},
233+
{
234+
locations: [
235+
{
236+
column: 7,
237+
line: 18,
238+
},
239+
],
240+
message: 'Maximum introspection depth exceeded',
241+
},
242+
{
243+
locations: [
244+
{
245+
column: 7,
246+
line: 33,
247+
},
248+
],
249+
message: 'Maximum introspection depth exceeded',
250+
},
233251
]);
234252
});
235253

@@ -324,6 +342,24 @@ describe('Validate: Max introspection nodes rule', () => {
324342
},
325343
],
326344
},
345+
{
346+
locations: [
347+
{
348+
column: 7,
349+
line: 18,
350+
},
351+
],
352+
message: 'Maximum introspection depth exceeded',
353+
},
354+
{
355+
locations: [
356+
{
357+
column: 7,
358+
line: 33,
359+
},
360+
],
361+
message: 'Maximum introspection depth exceeded',
362+
},
327363
]);
328364
});
329365

src/validation/rules/MaxIntrospectionDepthRule.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { GraphQLError } from '../../error/GraphQLError.js';
33
import type { ASTNode } from '../../language/ast.js';
44
import { Kind } from '../../language/kinds.js';
55
import type { ASTVisitor } from '../../language/visitor.js';
6-
import { BREAK } from '../../language/visitor.js';
76

87
import type { ValidationContext } from '../ValidationContext.js';
98

@@ -62,7 +61,7 @@ export function MaxIntrospectionDepthRule(
6261
nodes: [node],
6362
}),
6463
);
65-
return BREAK;
64+
return false;
6665
}
6766
}
6867
},

0 commit comments

Comments
 (0)