1 | <?php |
||
17 | class SchemaConfig extends AbstractConfig |
||
18 | { |
||
19 | |||
20 | public function getRules() |
||
21 | { |
||
22 | return [ |
||
23 | 'query' => ['type' => TypeService::TYPE_OBJECT_TYPE, 'required' => true], |
||
24 | 'mutation' => ['type' => TypeService::TYPE_OBJECT_TYPE], |
||
25 | 'types' => ['type' => TypeService::TYPE_ARRAY], |
||
26 | 'name' => ['type' => TypeService::TYPE_STRING], |
||
27 | |||
28 | ]; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @return AbstractObjectType |
||
33 | */ |
||
34 | 48 | public function getQuery() |
|
38 | |||
39 | /** |
||
40 | * @param $query AbstractObjectType |
||
41 | * |
||
42 | * @return SchemaConfig |
||
43 | */ |
||
44 | 7 | public function setQuery($query) |
|
50 | |||
51 | /** |
||
52 | * @return ObjectType |
||
53 | */ |
||
54 | 40 | public function getMutation() |
|
58 | |||
59 | /** |
||
60 | * @param $query AbstractObjectType |
||
61 | * |
||
62 | * @return SchemaConfig |
||
63 | */ |
||
64 | public function setMutation($query) |
||
65 | { |
||
66 | $this->data['mutation'] = $query; |
||
67 | |||
68 | return $this; |
||
69 | } |
||
70 | |||
71 | public function getName() |
||
72 | { |
||
73 | return $this->get('name', 'RootSchema'); |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @param array $types |
||
78 | * |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function setTypes(array $types) { |
||
82 | $this->data['types'] = $types; |
||
83 | |||
84 | return $this; |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * @return callable|mixed|null |
||
89 | */ |
||
90 | 5 | public function getTypes() { |
|
93 | |||
94 | } |
||
95 |