From 876d2f0d4488f2dae8c03c44606cdbc7526aff5e Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 13 Apr 2020 16:23:15 +1200 Subject: [PATCH] Enable ReadOnlyCacheService --- code/GraphQL/ReadFileQueryCreator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/GraphQL/ReadFileQueryCreator.php b/code/GraphQL/ReadFileQueryCreator.php index fcc8cfeca..1614c7916 100644 --- a/code/GraphQL/ReadFileQueryCreator.php +++ b/code/GraphQL/ReadFileQueryCreator.php @@ -4,6 +4,7 @@ use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; use GraphQL\Type\Definition\UnionType; +use SilverStripe\Assets\Services\ReadOnlyCacheService; use SilverStripe\GraphQL\Pagination\PaginatedQueryCreator; use SilverStripe\GraphQL\Pagination\Connection; use SilverStripe\Versioned\Versioned; @@ -23,6 +24,10 @@ public function attributes() public function createConnection() { + // class_exists check can be removed when assets 1.6 is released and required by framework + if (class_exists('SilverStripe\Assets\Services\ReadOnlyCacheService')) { + ReadOnlyCacheService::singleton()->setEnabled(true); + } return Connection::create('readFiles') ->setConnectionType(function () { return new UnionType([