@@ 265-273 (lines=9) @@ | ||
262 | // plugin instantiation at run-time unless a plugin is actually called from |
|
263 | // the graphql query execution. Plugins should take care of not having to |
|
264 | // instantiate their plugin instances during schema composition. |
|
265 | return array_map(function ($type) { |
|
266 | $manager = $this->typeManagers[$type['type']]; |
|
267 | /** @var \Drupal\graphql\Plugin\TypePluginInterface $instance */ |
|
268 | $instance = $manager->createInstance($type['id']); |
|
269 | ||
270 | return [ |
|
271 | 'definition' => $instance->getDefinition(), |
|
272 | ] + $type; |
|
273 | }, $types); |
|
274 | } |
|
275 | ||
276 | /** |
|
@@ 429-437 (lines=9) @@ | ||
426 | return $carry; |
|
427 | }, []); |
|
428 | ||
429 | return array_map(function ($definition) { |
|
430 | $id = $definition['id']; |
|
431 | $instance = $this->mutationManager->createInstance($id); |
|
432 | ||
433 | $carry[$id] = [ |
|
434 | 'id' => $id, |
|
435 | 'definition' => $instance->getDefinition(), |
|
436 | ]; |
|
437 | }, $mutations); |
|
438 | } |
|
439 | } |
|
440 |