mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-25 00:04:33 +02:00
36 lines
609 B
PHP
36 lines
609 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\GraphQL\Support;
|
|
|
|
use GraphQL\Type\Definition\Type;
|
|
use Rebing\GraphQL\Support\Facades\GraphQL;
|
|
|
|
final readonly class InputField
|
|
{
|
|
public function __construct(
|
|
private string $name,
|
|
private Type|string $type,
|
|
) {}
|
|
|
|
public function getName(): string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function getType(): Type
|
|
{
|
|
if (is_string($this->type)) {
|
|
return GraphQL::type($this->type);
|
|
}
|
|
|
|
return $this->type;
|
|
}
|
|
|
|
public function getRules(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|