Skip to content

Commit

Permalink
fix: allow maven and gradle plugins to have new parser options values…
Browse files Browse the repository at this point in the history
… configurable (#1930)

### 📝 Description

Previous val declaration for the additional parser options cannot be
reassigned - they should be a var and not val.

### 🔗 Related Issues

#1925
#1586
  • Loading branch information
mgilbey authored Feb 22, 2024
1 parent 44e5ed5 commit 0aea13e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ data class GraphQLParserOptions(
/** Modify the maximum number of whitespace tokens read to prevent processing extremely large queries */
var maxWhitespaceTokens: Int? = null,
/** Modify the maximum number of characters in a document to prevent malicious documents consuming CPU */
val maxCharacters: Int? = null,
var maxCharacters: Int? = null,
/** Modify the maximum grammar rule depth to negate malicious documents that can cause stack overflows */
val maxRuleDepth: Int? = null,
var maxRuleDepth: Int? = null,
/** Memory usage is significantly reduced by not capturing ignored characters, especially in SDL parsing. */
var captureIgnoredChars: Boolean? = null,
/** Single-line comments do not have any semantic meaning in GraphQL source documents and can be ignored */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ class ParserOptions {

/** Modify the maximum number of characters in a document to prevent malicious documents consuming CPU */
@Parameter
val maxCharacters: Int? = null
var maxCharacters: Int? = null

/** Modify the maximum grammar rule depth to negate malicious documents that can cause stack overflows */
@Parameter
val maxRuleDepth: Int? = null
var maxRuleDepth: Int? = null

/** Memory usage is significantly reduced by not capturing ignored characters, especially in SDL parsing. */
@Parameter
Expand Down

0 comments on commit 0aea13e

Please sign in to comment.