Package graphql.execution
Class ResultNodesInfo
java.lang.Object
graphql.execution.ResultNodesInfo
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 key
RESULT_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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
The number of result nodes created.int
boolean
If the number of result nodes has exceeded the maximum allowed numbers.void
-
Field Details
-
MAX_RESULT_NODES
- See Also:
-
RESULT_NODES_INFO
- See Also:
-
-
Constructor Details
-
ResultNodesInfo
public ResultNodesInfo()
-
-
Method Details
-
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
-