graphql-java added a max query tokens DDOS protect...
# graphql-kotlin
r
graphql-java added a max query tokens DDOS protection in 17.x (https://github.com/graphql-java/graphql-java/pull/2549/files). There is an ugly static method
ParserOptions.setDefaultParserOptions()
that can be used, but is there a cleaner way to set this for a
GraphQLServer
?
Ok, I see from graphql-java sources that I should be able to add a
ParserOptions
to the graphql context.
s
yeah in the graphQLContext can be configured, but it would be good to autoconfigure that through properties
r
Yes. I confirmed it does work via the context, though one has to be careful to specify the key with the
.java
extension on the class i.e.
ParserOptions::class.java
. A more native way to do that would be useful. It would also be useful to do that on a per request basis e.g. an annotation on a query method would be great.
125 Views