Class QueryComplexityLimits.Builder
java.lang.Object
graphql.validation.QueryComplexityLimits.Builder
- Enclosing class:
QueryComplexityLimits
Builder for QueryComplexityLimits.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()maxDepth(int maxDepth) Sets the maximum allowed depth for queries.maxFieldsCount(int maxFieldsCount) Sets the maximum allowed number of fields in a query.
-
Method Details
-
maxDepth
Sets the maximum allowed depth for queries. Depth is measured as the number of nested Field nodes.- Parameters:
maxDepth- the maximum depth (must be positive)- Returns:
- this builder
-
maxFieldsCount
Sets the maximum allowed number of fields in a query. Fields inside fragments are counted at each spread site.- Parameters:
maxFieldsCount- the maximum field count (must be positive)- Returns:
- this builder
-
build
- Returns:
- a new QueryComplexityLimits instance
-