@@ 5-24 (lines=20) @@ | ||
2 | ||
3 | namespace HansOtt\GraphQL\Schema; |
|
4 | ||
5 | final class Argument extends NodeBase |
|
6 | { |
|
7 | public $name; |
|
8 | public $type; |
|
9 | public $defaultValue; |
|
10 | ||
11 | /** |
|
12 | * @param string $name |
|
13 | * @param Type $type |
|
14 | * @param Value|null $defaultValue |
|
15 | * @param Location|null $location |
|
16 | */ |
|
17 | public function __construct($name, Type $type, Value $defaultValue = null, Location $location = null) |
|
18 | { |
|
19 | parent::__construct($location); |
|
20 | $this->name = (string) $name; |
|
21 | $this->type = $type; |
|
22 | $this->defaultValue = $defaultValue; |
|
23 | } |
|
24 | } |
|
25 |
@@ 5-29 (lines=25) @@ | ||
2 | ||
3 | namespace HansOtt\GraphQL\Schema; |
|
4 | ||
5 | final class Field extends NodeBase |
|
6 | { |
|
7 | public $name; |
|
8 | public $type; |
|
9 | public $arguments; |
|
10 | ||
11 | /** |
|
12 | * @param string $name |
|
13 | * @param Type $type |
|
14 | * @param Argument[] $arguments |
|
15 | * @param Location|null $location |
|
16 | */ |
|
17 | public function __construct($name, Type $type, array $arguments = array(), Location $location = null) |
|
18 | { |
|
19 | parent::__construct($location); |
|
20 | $this->name = (string) $name; |
|
21 | $this->type = $type; |
|
22 | $this->arguments = $arguments; |
|
23 | } |
|
24 | ||
25 | public function getChildren() |
|
26 | { |
|
27 | return $this->arguments; |
|
28 | } |
|
29 | } |
|
30 |