Skip to content

Commit 8fdd2c0

Browse files
committed
B2B-2255: "Currency" GraphQl query has no cache identity
1 parent b735588 commit 8fdd2c0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Directory\Model\Currency as CurrencyModel;
1414

1515
/**
16-
* Currency plugin
16+
* Currency plugin triggers clean page cache and provides currency cache identities
1717
*/
1818
class Currency implements IdentityInterface
1919
{
@@ -33,7 +33,7 @@ public function __construct(ManagerInterface $eventManager)
3333
}
3434

3535
/**
36-
* Add graphql store config tag to the store group cache identities.
36+
* Trigger clean cache by tags after save rates
3737
*
3838
* @param CurrencyModel $subject
3939
* @param CurrencyModel $result

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<type name="Magento\Framework\App\Cache\Tag\Strategy\Factory">
1010
<arguments>
1111
<argument name="customStrategies" xsi:type="array">
12-
<item name="Magento\Framework\App\Config\ValueInterface" xsi:type="object">\Magento\DirectoryGraphQl\Model\Cache\Tag\Strategy\CurrencyConfig</item>
12+
<item name="Magento\Framework\App\Config\ValueInterface" xsi:type="object">
13+
Magento\DirectoryGraphQl\Model\Cache\Tag\Strategy\CurrencyConfig
14+
</item>
1315
</argument>
1416
</arguments>
1517
</type>

dev/tests/api-functional/testsuite/Magento/GraphQl/Directory/CurrencyCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,13 @@ public function testCachePurgedWithExchangeRateChange(): void
501501

502502
// Query second store currency
503503
$secondStoreCode = 'second_store_view';
504-
$responseThirdStore = $this->graphQlQueryWithResponseHeaders(
504+
$responseSecondStore = $this->graphQlQueryWithResponseHeaders(
505505
$query,
506506
[],
507507
'',
508508
['Store' => $secondStoreCode]
509509
);
510-
$secondStoreCacheId = $responseThirdStore['headers'][CacheIdCalculator::CACHE_ID_HEADER];
510+
$secondStoreCacheId = $responseSecondStore['headers'][CacheIdCalculator::CACHE_ID_HEADER];
511511
// Verify we obtain a cache MISS at the 1st time
512512
$secondStoreResponse = $this->assertCacheMissAndReturnResponse(
513513
$query,

0 commit comments

Comments
 (0)