graphql-java-tools icon indicating copy to clipboard operation
graphql-java-tools copied to clipboard

Large schema file causes ParseCancelledException again

Open nnrudakov opened this issue 2 years ago • 0 comments

The same error as in #601 , but in different place.

Description

Failed to instantiate [graphql.kickstart.tools.SchemaParser]: Factory method 'schemaParser' threw exception; nested exception is graphql.parser.ParseCancelledException: Invalid Syntax : More than 15000 grammar tokens have been presented. To prevent Denial Of Service attacks, parsing has been cancelled

Expected behavior

Large schema files should be parsed without error.

Actual behavior

ParseCancelledException (see above)

Steps to reproduce the bug

Load large file:

SchemaParser.newParser()
            .file("schema.graphqls")
            .build()

Fail happens in this row https://github.com/graphql-java-kickstart/graphql-java-tools/blob/master/src/main/kotlin/graphql/kickstart/tools/SchemaParserBuilder.kt#L171

nnrudakov avatar Oct 12 '22 21:10 nnrudakov