mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
29 lines
582 B
PHP
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;
|
|
}
|
|
}
|