Skip to content

Commit

Permalink
Add benchmark for validating invalid query (#2079)
Browse files Browse the repository at this point in the history
Motivated by #2074
  • Loading branch information
IvanGoncharov committed Aug 8, 2019
1 parent ebcdfd2 commit e591e95
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 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);
}

0 comments on commit e591e95

Please sign in to comment.