src/Execution/Visitor/MaxComplexityQueryVisitor.php
public function visit(array $args, FieldConfig $fieldConfig, $childScore = 0)
    {
        $cost = $fieldConfig->get('cost', null);
        if (is_callable($cost)) {
            $cost = $cost($args, $fieldConfig, $childScore);
        }

        $cost = is_null($cost) ? $this->defaultScore : $cost;
        $this->memo += $cost;

        if ($this->memo > $this->maxScore) {
            throw new \Exception('query exceeded max allowed complexity of ' . $this->maxScore);
        }

        return $cost;
    }
public function visit(array $args, FieldConfig $fieldConfig, $childScore = 0)
    {
        $cost = $fieldConfig->get('cost', null);
        if (is_callable($cost)) {
            $cost = $cost($args, $fieldConfig, $childScore);
        }

        $cost = is_null($cost) ? $this->defaultScore : $cost;
        $this->memo += $cost;

        if ($this->memo > $this->maxScore) {
            throw new \Exception('query exceeded max allowed complexity of ' . $this->maxScore);
        }

        return $cost;
    }
{@inheritdoc}