mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-23 04:46:07 +02:00
39 lines
796 B
PHP
39 lines
796 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\GraphQL\Definition\Fields;
|
|
|
|
use App\Contracts\GraphQL\FilterableField;
|
|
use App\GraphQL\Definition\Directives\Filters\EqFilterDirective;
|
|
use App\GraphQL\Definition\Directives\Filters\FilterDirective;
|
|
use GraphQL\Type\Definition\Type;
|
|
|
|
/**
|
|
* Class BooleanField.
|
|
*/
|
|
abstract class BooleanField extends Field implements FilterableField
|
|
{
|
|
/**
|
|
* The type returned by the field.
|
|
*
|
|
* @return Type
|
|
*/
|
|
protected function type(): Type
|
|
{
|
|
return Type::boolean();
|
|
}
|
|
|
|
/**
|
|
* The directives available for this filter.
|
|
*
|
|
* @return FilterDirective[]
|
|
*/
|
|
public function filterDirectives(): array
|
|
{
|
|
return [
|
|
new EqFilterDirective($this, $this->type()),
|
|
];
|
|
}
|
|
}
|