-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add benchmark for validating invalid query (#2079)
Motivated by #2074
- Loading branch information
1 parent
ebcdfd2
commit e591e95
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @flow strict | ||
|
||
import { parse } from '../../language/parser'; | ||
import { buildSchema } from '../../utilities/buildASTSchema'; | ||
|
||
import { validate } from '../validate'; | ||
|
||
import { bigSchemaSDL } from '../../__fixtures__'; | ||
|
||
const schema = buildSchema(bigSchemaSDL, { assumeValid: true }); | ||
const queryAST = parse(` | ||
{ | ||
unknownField | ||
... on unknownType { | ||
anotherUnknownField | ||
...unknownFragment | ||
} | ||
} | ||
fragment TestFragment on anotherUnknownType { | ||
yetAnotherUnknownField | ||
} | ||
`); | ||
|
||
export const name = 'Validate Invalid Query'; | ||
export const count = 50; | ||
export function measure() { | ||
validate(schema, queryAST); | ||
} |