Skip to content

Commit 789e08f

Browse files
committed
B2B-2255: "Currency" GraphQl query has no cache identity
1 parent 40ca1d4 commit 789e08f

File tree

6 files changed

+762
-37
lines changed

6 files changed

+762
-37
lines changed

app/code/Magento/DirectoryGraphQl/Model/Cache/Tag/Strategy/Currency.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

app/code/Magento/DirectoryGraphQl/Plugin/Currency.php

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

88
namespace Magento\DirectoryGraphQl\Plugin;
99

10+
use Magento\DirectoryGraphQl\Model\Resolver\Currency\Identity;
11+
use Magento\Framework\DataObject\IdentityInterface;
1012
use Magento\Framework\Event\ManagerInterface;
1113
use Magento\Directory\Model\Currency as CurrencyModel;
1214

1315
/**
1416
* Currency plugin
1517
*/
16-
class Currency
18+
class Currency implements IdentityInterface
1719
{
1820
/**
1921
* Application Event Dispatcher
@@ -40,7 +42,15 @@ public function __construct(ManagerInterface $eventManager)
4042
*/
4143
public function afterSaveRates(CurrencyModel $subject, CurrencyModel $result): CurrencyModel
4244
{
43-
$this->eventManager->dispatch('clean_cache_by_tags', ['object' => $result]);
45+
$this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this]);
4446
return $result;
4547
}
48+
49+
/**
50+
* @inheritdoc
51+
*/
52+
public function getIdentities()
53+
{
54+
return [Identity::CACHE_TAG];
55+
}
4656
}

app/code/Magento/DirectoryGraphQl/etc/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<arguments>
1111
<argument name="customStrategies" xsi:type="array">
1212
<item name="Magento\Framework\App\Config\ValueInterface" xsi:type="object">\Magento\DirectoryGraphQl\Model\Cache\Tag\Strategy\CurrencyConfig</item>
13-
<item name="Magento\Directory\Model\Currency" xsi:type="object">\Magento\DirectoryGraphQl\Model\Cache\Tag\Strategy\Currency</item>
1413
</argument>
1514
</arguments>
1615
</type>

0 commit comments

Comments
 (0)