@@ 234-247 (lines=14) @@ | ||
231 | * |
|
232 | * @return array |
|
233 | */ |
|
234 | public function resolveFields($fields) { |
|
235 | return array_map(function ($id) use ($fields) { |
|
236 | $field = $this->getType(GRAPHQL_FIELD_PLUGIN, $id); |
|
237 | list($type, $decorators) = $field['type']; |
|
238 | ||
239 | $type = array_reduce($decorators, function ($a, $decorator) use ($type) { |
|
240 | return $decorator($a); |
|
241 | }, $this->getTypeByName($type)); |
|
242 | ||
243 | return [ |
|
244 | 'type' => $type, |
|
245 | ] + $field; |
|
246 | }, $fields); |
|
247 | } |
|
248 | ||
249 | /** |
|
250 | * @param $args |
|
@@ 254-266 (lines=13) @@ | ||
251 | * |
|
252 | * @return array |
|
253 | */ |
|
254 | public function resolveArgs($args) { |
|
255 | return array_map(function ($arg) { |
|
256 | list($type, $decorators) = $arg['type']; |
|
257 | ||
258 | $type = array_reduce($decorators, function ($a, $decorator) use ($type) { |
|
259 | return $decorator($a); |
|
260 | }, $this->getTypeByName($type)); |
|
261 | ||
262 | return [ |
|
263 | 'type' => $type, |
|
264 | ] + $arg; |
|
265 | }, $args); |
|
266 | } |
|
267 | ||
268 | } |
|
269 |