Files
animethemes-server/app/GraphQL/Definition/Fields/Search/SearchSongsField.php
T

44 lines
812 B
PHP

<?php
declare(strict_types=1);
namespace App\GraphQL\Definition\Fields\Search;
use App\GraphQL\Definition\Fields\Field;
use App\GraphQL\Definition\Types\Wiki\SongType;
use GraphQL\Type\Definition\Type;
/**
* Class SearchSongsField.
*/
class SearchSongsField extends Field
{
/**
* Create a new field instance.
*/
public function __construct()
{
parent::__construct('songs', nullable: false);
}
/**
* The description of the field.
*
* @return string
*/
public function description(): string
{
return 'The song results of the search';
}
/**
* The type returned by the field.
*
* @return Type
*/
protected function type(): Type
{
return Type::listOf(Type::nonNull(new SongType()));
}
}