diff --git a/src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php b/src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php index 47d1e7f2c..905579916 100644 --- a/src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php +++ b/src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php @@ -174,9 +174,12 @@ protected function getSchemaDocument(array $extensions = []) { }); $schema = array_merge([$this->getSchemaDefinition()], $extensions); - $ast = Parser::parse(implode("\n\n", $schema)); + $schema = implode("\n\n", $schema); + // Parsing only to check syntax errors in the current schema. + $ast = Parser::parse($schema); if (empty($this->inDevelopment)) { - $this->astCache->set($cid, $ast, CacheBackendInterface::CACHE_PERMANENT, ['graphql']); + // Caching schema string. + $this->astCache->set($cid, $schema, CacheBackendInterface::CACHE_PERMANENT, ['graphql']); } return $ast;