Class ComplexityAnalyzer


  • public class ComplexityAnalyzer
    extends Object
    Class used to perform static complexity analysis on the parsed operation AST. It recursively walks the AST and accumulates the complexity scores. Once the threshold is exceeded, it throws a ComplexityLimitExceededException. The complexity score calculation for each node is delegated to ComplexityFunction.
    • Method Detail

      • complexity

        public int complexity​(graphql.execution.ExecutionContext context)