diff --git a/src/validation/__tests__/validateInvalidGQL-benchmark.js b/src/validation/__tests__/validateInvalidGQL-benchmark.js new file mode 100644 index 0000000000..13e9402d64 --- /dev/null +++ b/src/validation/__tests__/validateInvalidGQL-benchmark.js @@ -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); +}