drupal-graphql / drupal-graphql/graphql

cache error

Open
#1,269 2 comments 0 reactions 0 assignees View on GitHub
4.x bug
Dominant language
PHP
Stars
287
Forks
198
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/6778631/157265439-e1a014bd-c969-4fec-a04d-99e0cd43fd68.png)

if enable this line :

```

// if (empty($this->inDevelopment)) {
// $this->astCache->set($cid, json_encode($ast), CacheBackendInterface::CACHE_PERMANENT, ['graphql']);
// }

```

**got 502 error**

```

protected function getSchemaDocument(array $extensions = [])
{
// Only use caching of the parsed document if we aren't in development mode.
$cid = "schema:{$this->getPluginId()}";
// if (empty($this->inDevelopment) && $cache = $this->astCache->get($cid)) {
// return json_decode($cache->data);
// }

$extensions = array_filter(array_map(function (SchemaExtensionPluginInterface $extension) {
return $extension->getBaseDefinition();
}, $extensions), function ($definition) {
return !empty($definition);
});

$schema = array_merge([$this->getSchemaDefinition()], $extensions);
$ast = Parser::parse(implode("\n\n", $schema));
// if (empty($this->inDevelopment)) {
// $this->astCache->set($cid, json_encode($ast), CacheBackendInterface::CACHE_PERMANENT, ['graphql']);
// }

return $ast;
}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.