graphql-kotlin
graphql-kotlin copied to clipboard
Build plugins should allow configuring max parse tokens
Generate SDL task/mojo currently do not allow configuring this option and instead rely on the defaults provided by graphql-java
. Since it is possible to configure this option when build a GraphQL server, we should also allow configuring it in build plugins.
@dariuszkuc I just saw this coming back with
graphql-kotlin
version 6.2.1. That version depends ongraphql-java
19.1 which does allow to configure themaxTokens
inParserOptions
, but I do not see that option being exposed by the Gradle plugin. Am I missing something?
Originally posted by @sschuberth in https://github.com/ExpediaGroup/graphql-kotlin/issues/1303#issuecomment-1222215513
we have 2 options:
- Manually set the default parser options
ParserOptions.setDefaultParserOptions(ParserOptions.newParserOptions().maxTokens(<YOUR_NEW_VALUE>).build())
- specify parserOptions in the
GraphQLContext
https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/ParseAndValidate.java#L64
@samuelAndalon yes thats how you configure it on the server, this issue is about the build plugin allowing this configuration to generate the SDL
Indeed, it would be nice if the whole ParserOptions
would be exposed as a Gradle plugin extension, so things like maxToken
can easily be set from the Gradle build script DSL.
Just a friendly ping to @dariuszkuc: Is this planned to be worked on any time soon? It currently blocks us from using GitHub's GraphQL schema with the latest version of this plugin, which we'd like to take into use for Ktor 2 support.