for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Application\Api\Field\Query;
use Application\Model\User;
use Ecodev\Felix\Api\Field\FieldInterface;
abstract class Viewer implements FieldInterface
{
public static function build(): array
return
[
'name' => 'viewer',
'type' => _types()->getOutput(User::class),
'description' => 'Represents currently logged-in user',
'resolve' => function ($root, array $args): ?User {
return User::getCurrent();
},
];
}