Files
animethemes-server/app/GraphQL/Schema/Inputs/Relations/CreateBelongsToInput.php
T

35 lines
799 B
PHP

<?php
declare(strict_types=1);
namespace App\GraphQL\Schema\Inputs\Relations;
use App\GraphQL\Schema\Inputs\Input;
use App\GraphQL\Schema\Types\EloquentType;
use App\GraphQL\Support\InputField;
use GraphQL\Type\Definition\Type;
class CreateBelongsToInput extends Input
{
public function __construct(
protected EloquentType $type,
) {}
public function getName(): string
{
return "Create{$this->type->getName()}BelongsTo";
}
/**
* @return InputField[]
*/
public function fieldClasses(): array
{
return [
new InputField('connect', Type::int()),
new InputField('create', "Create{$this->type->getName()}Input"),
new InputField('update', "Update{$this->type->getName()}Input"),
];
}
}