Skip to content

Commit e591e95

Browse files
Add benchmark for validating invalid query (#2079)
Motivated by #2074
1 parent ebcdfd2 commit e591e95

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// @flow strict
2+
3+
import { parse } from '../../language/parser';
4+
import { buildSchema } from '../../utilities/buildASTSchema';
5+
6+
import { validate } from '../validate';
7+
8+
import { bigSchemaSDL } from '../../__fixtures__';
9+
10+
const schema = buildSchema(bigSchemaSDL, { assumeValid: true });
11+
const queryAST = parse(`
12+
{
13+
unknownField
14+
... on unknownType {
15+
anotherUnknownField
16+
...unknownFragment
17+
}
18+
}
19+
20+
fragment TestFragment on anotherUnknownType {
21+
yetAnotherUnknownField
22+
}
23+
`);
24+
25+
export const name = 'Validate Invalid Query';
26+
export const count = 50;
27+
export function measure() {
28+
validate(schema, queryAST);
29+
}

0 commit comments

Comments
 (0)