Skip to content

Commit 73a8ee9

Browse files
committed
B2B-2258: Add caching capability to the storeConfig GraphQl query
1 parent aa72aaf commit 73a8ee9

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

app/code/Magento/StoreGraphQl/Model/Cache/Tag/Strategy/StoreConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
namespace Magento\StoreGraphQl\Model\Cache\Tag\Strategy;
99

10-
use Magento\Config\App\Config\Type\System;
1110
use Magento\Framework\App\Cache\Tag\StrategyInterface;
1211
use Magento\Framework\App\Config\ValueInterface;
12+
use Magento\StoreGraphQl\Model\Resolver\Store\ConfigIdentity;
1313

1414
/**
1515
* Produce cache tags for store config.
@@ -26,7 +26,7 @@ public function getTags($object): array
2626
}
2727

2828
if ($object instanceof ValueInterface && $object->isValueChanged()) {
29-
return [System::CACHE_TAG];
29+
return [ConfigIdentity::CACHE_TAG];
3030
}
3131

3232
return [];

app/code/Magento/StoreGraphQl/Model/Resolver/Store/Identity.php renamed to app/code/Magento/StoreGraphQl/Model/Resolver/Store/ConfigIdentity.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,20 @@
77

88
namespace Magento\StoreGraphQl\Model\Resolver\Store;
99

10-
use Magento\Config\App\Config\Type\System;
1110
use Magento\Framework\GraphQl\Query\Resolver\IdentityInterface;
1211

13-
class Identity implements IdentityInterface
12+
class ConfigIdentity implements IdentityInterface
1413
{
1514
/**
1615
* @var string
1716
*/
18-
private $cacheTag = System::CACHE_TAG;
17+
const CACHE_TAG = 'gql_store_config';
1918

2019
/**
2120
* @inheritDoc
2221
*/
2322
public function getIdentities(array $resolvedData): array
2423
{
25-
$ids = empty($resolvedData) ?
26-
[] : [$this->cacheTag];
27-
return $ids;
24+
return empty($resolvedData) ? [] : [self::CACHE_TAG];
2825
}
2926
}

0 commit comments

Comments
 (0)