Skip to content

Commit

Permalink
https://github.com/manifold-systems/manifold/issues/536
Browse files Browse the repository at this point in the history
- override java-graphql ParserOptions which are not applicable to compile-time use e.g., maxTokens
  • Loading branch information
rsmckinney committed Dec 14, 2023
1 parent 65547ec commit c7bb180
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import javax.tools.DiagnosticListener;
import javax.tools.JavaFileObject;

import graphql.parser.ParserEnvironment;
import graphql.parser.ParserOptions;
import graphql.schema.idl.TypeDefinitionRegistry;
import manifold.api.fs.IFile;
import manifold.api.fs.IFileFragment;
Expand Down Expand Up @@ -127,8 +129,14 @@ private void parse()

private void parse( Reader schemaInput ) throws ParseCancellationException
{
Parser parser = new Parser();
Document document = parser.parseDocument( schemaInput );
Document document = Parser.parse( ParserEnvironment.newParserEnvironment()
.parserOptions( ParserOptions.newParserOptions()
.maxTokens( Integer.MAX_VALUE )
.maxWhitespaceTokens( Integer.MAX_VALUE )
.captureSourceLocation( true )
.build() )
.document( schemaInput )
.build() );
buildRegistry( document );
}

Expand Down

0 comments on commit c7bb180

Please sign in to comment.