public static function buildHumanType()
{
if (null !== self::$humanType) {
return self::$humanType;
}
self::$humanType = new ObjectType(['name' => 'Human', 'fields' => function () {
return ['firstName' => ['type' => Type::nonNull(Type::string())], 'dogs' => ['type' => Type::nonNull(Type::listOf(Type::nonNull(self::buildDogType()))), 'complexity' => function ($childrenComplexity, $args) {
$complexity = isset($args['name']) ? 1 : 10;
return $childrenComplexity + $complexity;
}, 'args' => ['name' => ['type' => Type::string()]]]];
}]);
return self::$humanType;
}