Skip to content

Commit 0aea13e

Browse files
authored
fix: allow maven and gradle plugins to have new parser options values 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
1 parent 44e5ed5 commit 0aea13e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/graphql-kotlin-gradle-plugin/src/main/kotlin/com/expediagroup/graphql/plugin/gradle/config/GraphQLParserOptions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ data class GraphQLParserOptions(
1212
/** Modify the maximum number of whitespace tokens read to prevent processing extremely large queries */
1313
var maxWhitespaceTokens: Int? = null,
1414
/** Modify the maximum number of characters in a document to prevent malicious documents consuming CPU */
15-
val maxCharacters: Int? = null,
15+
var maxCharacters: Int? = null,
1616
/** Modify the maximum grammar rule depth to negate malicious documents that can cause stack overflows */
17-
val maxRuleDepth: Int? = null,
17+
var maxRuleDepth: Int? = null,
1818
/** Memory usage is significantly reduced by not capturing ignored characters, especially in SDL parsing. */
1919
var captureIgnoredChars: Boolean? = null,
2020
/** Single-line comments do not have any semantic meaning in GraphQL source documents and can be ignored */

plugins/graphql-kotlin-maven-plugin/src/main/kotlin/com/expediagroup/graphql/plugin/maven/GenerateClientAbstractMojo.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@ class ParserOptions {
232232

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

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

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

0 commit comments

Comments
 (0)