GraphQL\Validator\Rules\QueryComplexity::fieldComplexity PHP Method

fieldComplexity() private method

private fieldComplexity ( $node, $complexity )
    private function fieldComplexity($node, $complexity = 0)
    {
        if (isset($node->selectionSet) && $node->selectionSet instanceof SelectionSetNode) {
            foreach ($node->selectionSet->selections as $childNode) {
                $complexity = $this->nodeComplexity($childNode, $complexity);
            }
        }
        return $complexity;
    }