Class 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 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

    • Constructor Detail

      • ResultNodesInfo

        public ResultNodesInfo()
    • 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