Skip to content

Any way to modify graphql-java Denial of Service protection limits? #1262

Answered by mafigi
mafigi asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, I've found the solution:

First import ParserOptions from graphql-java:

import graphql.parser.ParserOptions

And then in the code generation task add following config:

doFirst {
        ParserOptions.setDefaultParserOptions(
                ParserOptions.newParserOptions()
                        .maxTokens(<YOUR_MAX_TOKENS_HERE>) 
                        .maxCharacters(<YOUR_MAX_CHARACTERS_HERE>)
                        .build());
    }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mafigi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants