-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathAbstractRequest.php
More file actions
37 lines (30 loc) · 1 KB
/
AbstractRequest.php
File metadata and controls
37 lines (30 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
namespace TheCodingMachine\GraphQLite\Annotations;
abstract class AbstractRequest
{
private string|null $outputType;
private string|null $name;
/** @param mixed[] $attributes */
public function __construct(array $attributes = [], string|null $name = null, string|null $outputType = null)
{
$this->outputType = $outputType ?? $attributes['outputType'] ?? null;
$this->name = $name ?? $attributes['name'] ?? null;
}
/**
* Returns the GraphQL return type of the request (as a string).
* The string can represent the FQCN of the type or an entry in the container resolving to the GraphQL type.
*/
public function getOutputType(): string|null
{
return $this->outputType;
}
/**
* Returns the name of the GraphQL query/mutation/field.
* If not specified, the name of the method should be used instead.
*/
public function getName(): string|null
{
return $this->name;
}
}