Skip to content

cache error #1269

Open
Open
@jubilee-hub

Description

@jubilee-hub

image

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions