Package graphql.execution
Class ResultNodesInfo
- java.lang.Object
-
- graphql.execution.ResultNodesInfo
-
@PublicApi public class ResultNodesInfo extends java.lang.Object
This class is used to track the number of result nodes that have been created during execution. After each execution the GraphQLContext contains a ResultNodeInfo object under the keyRESULT_NODES_INFO
The number of result can be limited (and should be for security reasons) by setting the maximum number of result nodes in the GraphQLContext under the key
MAX_RESULT_NODES
to an Integer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MAX_RESULT_NODES
static java.lang.String
RESULT_NODES_INFO
-
Constructor Summary
Constructors Constructor Description ResultNodesInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getResultNodesCount()
The number of result nodes created.int
incrementAndGetResultNodesCount()
boolean
isMaxResultNodesExceeded()
If the number of result nodes has exceeded the maximum allowed numbers.void
maxResultNodesExceeded()
-
-
-
Field Detail
-
MAX_RESULT_NODES
public static final java.lang.String MAX_RESULT_NODES
- See Also:
- Constant Field Values
-
RESULT_NODES_INFO
public static final java.lang.String RESULT_NODES_INFO
- See Also:
- Constant Field Values
-
-
Method Detail
-
incrementAndGetResultNodesCount
public int incrementAndGetResultNodesCount()
-
maxResultNodesExceeded
public void maxResultNodesExceeded()
-
getResultNodesCount
public int getResultNodesCount()
The number of result nodes created. Note: this can be higher than max result nodes because a each node that exceeds the number of max nodes is set to null, but still is a result node (with value null)- Returns:
- number of result nodes created
-
isMaxResultNodesExceeded
public boolean isMaxResultNodesExceeded()
If the number of result nodes has exceeded the maximum allowed numbers.- Returns:
- true if the number of result nodes has exceeded the maximum allowed numbers
-
-