mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
35 lines
756 B
PHP
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();
|
|
}
|
|
}
|