1 | <?php |
||
17 | abstract class SchemaPluginBase extends PluginBase implements PluggableSchemaPluginInterface, ContainerFactoryPluginInterface { |
||
18 | |||
19 | use DependencySerializationTrait; |
||
20 | |||
21 | /** |
||
22 | * The schema builder object. |
||
23 | * |
||
24 | * @var \Drupal\graphql\Plugin\GraphQL\PluggableSchemaBuilderInterface |
||
25 | */ |
||
26 | protected $schemaBuilder; |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { |
||
39 | |||
40 | /** |
||
41 | * SchemaPluginBase constructor. |
||
42 | * |
||
43 | * @param array $configuration |
||
44 | * The plugin configuration array. |
||
45 | * @param string $pluginId |
||
46 | * The plugin id. |
||
47 | * @param array $pluginDefinition |
||
48 | * The plugin definition array. |
||
49 | * @param \Drupal\graphql\Plugin\GraphQL\TypeSystemPluginManagerAggregator $pluginManagers |
||
50 | * Type system plugin manager aggregator service. |
||
51 | */ |
||
52 | public function __construct($configuration, $pluginId, $pluginDefinition, TypeSystemPluginManagerAggregator $pluginManagers) { |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function getSchemaBuilder() { |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function getSchema() { |
||
82 | |||
83 | /** |
||
84 | * Extract type or field definitions from plugins. |
||
85 | * |
||
86 | * @param array $plugins |
||
87 | * The list of plugins to extract the type or field definitions from. |
||
88 | * |
||
89 | * @return array |
||
90 | * The list of extracted type or field definitions. |
||
91 | */ |
||
92 | protected function extractDefinitions(array $plugins) { |
||
97 | |||
98 | /** |
||
99 | * Retrieve all mutations. |
||
100 | * |
||
101 | * @return \Drupal\graphql\Plugin\GraphQL\TypeSystemPluginInterface[] |
||
102 | * The list of mutation plugins. |
||
103 | */ |
||
104 | protected function getMutations() { |
||
109 | |||
110 | /** |
||
111 | * Retrieve all fields that are not associated with a specific type. |
||
112 | * |
||
113 | * @return \Drupal\graphql\Plugin\GraphQL\TypeSystemPluginInterface[] |
||
114 | * The list root field plugins. |
||
115 | */ |
||
116 | protected function getRootFields() { |
||
123 | |||
124 | /** |
||
125 | * Retrieve all types to be registered explicitly. |
||
126 | * |
||
127 | * @return \Drupal\graphql\Plugin\GraphQL\TypeSystemPluginInterface[] |
||
128 | * The list of types to be registered explicitly. |
||
129 | */ |
||
130 | protected function getTypes() { |
||
139 | |||
140 | } |
||
141 |