Files
animethemes-server/app/GraphQL/Support/Relations/MorphManyRelation.php
T
2025-08-27 03:47:27 -03:00

29 lines
582 B
PHP

<?php
declare(strict_types=1);
namespace App\GraphQL\Support\Relations;
use App\Enums\GraphQL\PaginationType;
use GraphQL\Type\Definition\Type;
use Rebing\GraphQL\Support\Facades\GraphQL;
class MorphManyRelation extends Relation
{
/**
* The type returned by the field.
*/
public function type(): Type
{
return Type::nonNull(GraphQL::paginate($this->rebingType->getName()));
}
/**
* The pagination type if applicable.
*/
public function paginationType(): PaginationType
{
return PaginationType::PAGINATOR;
}
}