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