Skip to content

Commit

Permalink
Don't limit amount of reported errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtech-dobes committed May 19, 2022
1 parent 1202c4e commit 744e54d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/validator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from 'graphql';
import { parse, version } from 'graphql';
import { validate } from 'graphql/validation';
import { buildASTSchema } from 'graphql/utilities/buildASTSchema';
import { GraphQLError } from 'graphql/error';
Expand Down Expand Up @@ -65,7 +65,18 @@ export function validateSchemaDefinition(inputSchema, rules, configuration) {
return ruleWithConfiguration(rule, configuration);
});

const errors = validate(schema, ast, rulesWithConfiguration);
const isGraphQLVersion15 = version.startsWith('15');
const validateOptions = {
maxErrors: Number.MAX_SAFE_INTEGER,
};

const errors = validate(
schema,
ast,
rulesWithConfiguration,
isGraphQLVersion15 ? undefined : validateOptions,
isGraphQLVersion15 ? validateOptions : undefined
);
const sortedErrors = sortErrors(errors);
const errorFilters = [
inlineConfigErrorFilter(ast, inputSchema),
Expand Down

0 comments on commit 744e54d

Please sign in to comment.