Files
animethemes-server/app/GraphQL/Definition/Fields/User/Notification/NotificationDataField.php
T
2025-07-24 01:22:29 -03:00

35 lines
756 B
PHP

<?php
declare(strict_types=1);
namespace App\GraphQL\Definition\Fields\User\Notification;
use App\GraphQL\Definition\Fields\JsonField;
use App\GraphQL\Definition\Types\User\Notification\NotificationDataType;
use App\Models\User\Notification;
use GraphQL\Type\Definition\Type;
class NotificationDataField extends JsonField
{
public function __construct()
{
parent::__construct(Notification::ATTRIBUTE_DATA, nullable: false);
}
/**
* The description of the field.
*/
public function description(): string
{
return 'The JSON data of the notification';
}
/**
* The type returned by the field.
*/
public function type(): Type
{
return new NotificationDataType();
}
}