Files
animethemes-server/app/GraphQL/Support/Relations/HasManyRelation.php
T

32 lines
578 B
PHP

<?php
declare(strict_types=1);
namespace App\GraphQL\Support\Relations;
use App\Enums\GraphQL\RelationType;
use GraphQL\Type\Definition\Type;
class HasManyRelation extends Relation
{
/**
* The type returned by the field.
*/
public function type(): Type
{
if (! $this->nullable) {
return Type::nonNull(Type::listOf($this->type));
}
return Type::listOf($this->type);
}
/**
* The Relation type.
*/
protected function relation(): RelationType
{
return RelationType::HAS_MANY;
}
}