Skip to content

Commit b920fdd

Browse files
Al MunningsKlaus Purer
authored andcommitted
fix(AlterableComposableSchema): Use getCacheId() in getSchemaDocument() as in the parent class (#3477239 by almunnings)
1 parent 6c31792 commit b920fdd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/GraphQL/Validator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,12 @@ public function getOrphanedResolvers(ServerInterface $server, array $ignore_type
194194
*/
195195
private function getSchemaPlugin(ServerInterface $server) : SchemaPluginInterface {
196196
$schema_name = $server->get('schema');
197+
$plugin_config = ['server_id' => $server->id()];
197198
/** @var \Drupal\graphql\Plugin\SchemaPluginInterface $plugin */
198199
$plugin = $this->pluginManager->createInstance($schema_name);
199200
if ($plugin instanceof ConfigurableInterface && $config = $server->get('schema_configuration')) {
200-
$plugin->setConfiguration($config[$schema_name] ?? []);
201+
$schema_config = $config[$schema_name] ?? [];
202+
$plugin->setConfiguration($schema_config + $plugin_config);
201203
}
202204

203205
return $plugin;

src/Plugin/GraphQL/Schema/AlterableComposableSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function __construct(
113113
*/
114114
protected function getSchemaDocument(array $extensions = []) {
115115
// Only use caching of the parsed document if we aren't in development mode.
116-
$cid = "schema:{$this->getPluginId()}";
116+
$cid = $this->getCacheId('schema');
117117
if (empty($this->inDevelopment) && $cache = $this->astCache->get($cid)) {
118118
return $cache->data;
119119
}

0 commit comments

Comments
 (0)