Files
animethemes-server/app/GraphQL/Support/InputField.php
T
2025-10-01 17:18:31 -03:00

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 [];
}
}