From c7bb180a3b994d4a72d94f02531a6e17f26aac6b Mon Sep 17 00:00:00 2001 From: scott Date: Thu, 14 Dec 2023 17:29:09 -0500 Subject: [PATCH] https://github.com/manifold-systems/manifold/issues/536 - override java-graphql ParserOptions which are not applicable to compile-time use e.g., maxTokens --- .../main/java/manifold/graphql/type/GqlModel.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/manifold-deps-parent/manifold-graphql/src/main/java/manifold/graphql/type/GqlModel.java b/manifold-deps-parent/manifold-graphql/src/main/java/manifold/graphql/type/GqlModel.java index b556fae2a..82f247571 100644 --- a/manifold-deps-parent/manifold-graphql/src/main/java/manifold/graphql/type/GqlModel.java +++ b/manifold-deps-parent/manifold-graphql/src/main/java/manifold/graphql/type/GqlModel.java @@ -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; @@ -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 ); }