1 | <?php |
||
18 | abstract class SchemaPluginBase extends AbstractSchema implements SchemaPluginInterface { |
||
19 | |||
20 | use PluginTrait; |
||
21 | |||
22 | /** |
||
23 | * The response cache metadata object. |
||
24 | * |
||
25 | * @var \Drupal\Core\Cache\CacheableMetadata |
||
26 | */ |
||
27 | protected $responseMetadata; |
||
28 | |||
29 | /** |
||
30 | * The schema cache metadata object. |
||
31 | * |
||
32 | * @var \Drupal\Core\Cache\CacheableMetadata |
||
33 | */ |
||
34 | protected $schemaMetadata; |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function __construct($configuration, $pluginId, $pluginDefinition) { |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function buildConfig(SchemaBuilderInterface $schemaBuilder) { |
||
50 | |||
51 | /** |
||
52 | * Constructs the schema configuration. |
||
53 | * |
||
54 | * @param \Drupal\graphql\Plugin\GraphQL\SchemaBuilderInterface $schemaBuilder |
||
55 | * The schema builder. |
||
56 | */ |
||
57 | protected function constructSchema(SchemaBuilderInterface $schemaBuilder) { |
||
60 | |||
61 | /** |
||
62 | * Constructs the schema cache metadata. |
||
63 | * |
||
64 | * @param \Drupal\graphql\Plugin\GraphQL\SchemaBuilderInterface $schemaBuilder |
||
65 | * The schema builder. |
||
66 | */ |
||
67 | protected function constructCacheMetadata(SchemaBuilderInterface $schemaBuilder) { |
||
94 | |||
95 | /** |
||
96 | * Collects schema cache metadata from all types registered with the schema. |
||
97 | * |
||
98 | * The cache metadata is statically cached. This means that the schema may not |
||
99 | * be modified after this method has been called. |
||
100 | * |
||
101 | * @return \Drupal\Core\Cache\CacheableMetadata |
||
102 | * The cache metadata collected from the schema's types. |
||
103 | */ |
||
104 | public function getSchemaCacheMetadata() { |
||
107 | |||
108 | /** |
||
109 | * Collects result cache metadata from all types registered with the schema. |
||
110 | * |
||
111 | * The cache metadata is statically cached. This means that the schema may not |
||
112 | * be modified after this method has been called. |
||
113 | * |
||
114 | * @return \Drupal\Core\Cache\CacheableMetadata |
||
115 | * The cache metadata collected from the schema's types. |
||
116 | */ |
||
117 | public function getResponseCacheMetadata() { |
||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | public function build(SchemaConfig $config) { |
||
127 | } |
||
128 |