Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
87ee7b5 to
5aa6166
Compare
Contributor
|
You also want to limit the max chars overall + the max white space tokens (if they count differently) Here are the limits GJ uses by default: https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/parser/ParserOptions.java They should not be optional or off by default but we should rather rather set them to a high value by default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By checking
maxTokensinside thecreateTokenfunction we can be sure that it's applied consistently.I've also moved ParserOptions.lexer to be an internal property (it should only be used by the schema coordinates parser, it was never intended to be a public interface) and implemented an assertion that forbids
lexerandmaxTokenstogether (since if they were both set,maxTokenswould be ignored). I've also marked the SchemaCoordinateLexer as internal; we don't expose it viaindex.tsanyway, but best to signal the intent anyway.I'm not super happy about mutating the internal state of the lexer from
createToken- really I'd rathercreateTokenwere a method on the lexer class - but I don't want the two Lexers to have to implement it each and we don't like to extend classes so I think we can accept it in this one place. I'm not happy about it though, so if you have ideas for a better approach, please go ahead!