javaspring-bootgraphqlgraphql-javanetflix-dgs

More than 15000 parse tokens have been presented


I am using Spring Boot with Netflix DGS (GraphQL) frameworks. I need to mutation my type which is big "Object" with recursive binding. When I want to use mutation, the DGS framework responses me with this error message:

More than 15000 parse tokens have been presented. To prevent Denial Of Service attacks, parsing has been cancelled. offending token ':' at line 1 column 97831

It is possible to increase this limitation by some configuration ideally maybe in application.yml, or in some GraphQL config?

Thanks for any answer.


Solution

  • I think this is related to this change: https://github.com/graphql-java/graphql-java/pull/2549

    New limits have been introduced to GraphQL.

    You can use graphql.parser.ParserOptions; to set a higher maxTokens value.