Package graphql.analysis
Class QueryComplexityCalculator
- java.lang.Object
-
- graphql.analysis.QueryComplexityCalculator
-
@PublicApi public class QueryComplexityCalculator extends java.lang.Object
This can calculate the complexity of an operation using the specifiedFieldComplexityCalculator
you pass into it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryComplexityCalculator.Builder
-
Constructor Summary
Constructors Constructor Description QueryComplexityCalculator(QueryComplexityCalculator.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
calculate()
java.util.Map<QueryVisitorFieldEnvironment,java.lang.Integer>
calculateByParents()
static QueryComplexityCalculator.Builder
newCalculator()
-
-
-
Constructor Detail
-
QueryComplexityCalculator
public QueryComplexityCalculator(QueryComplexityCalculator.Builder builder)
-
-
Method Detail
-
calculate
public int calculate()
-
calculateByParents
public java.util.Map<QueryVisitorFieldEnvironment,java.lang.Integer> calculateByParents()
- Returns:
- a map that shows the field complexity for each field level in the operation
-
newCalculator
public static QueryComplexityCalculator.Builder newCalculator()
-
-