Skip to content

Commit 02ca086

Browse files
committed
B2B-2677: [MediaGallery]Implement data caching for GraphQL results on resolver level
- Remove condition that is always true
1 parent 6f797df commit 02ca086

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

app/code/Magento/GraphQlResolverCache/Model/Resolver/Result/ValueProcessor.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,14 @@ private function hydrateData(array &$value): void
139139
if (isset($reference['cacheKey']) && isset($reference['index'])) {
140140
$cacheKey = $reference['cacheKey'];
141141
$index = $reference['index'];
142-
if ($cacheKey) {
143-
if (isset($this->processedValues[$cacheKey][$index])) {
144-
$value = $this->processedValues[$cacheKey][$index];
145-
} elseif (isset($this->hydrators[$cacheKey])
146-
&& $this->hydrators[$cacheKey] instanceof HydratorInterface
147-
) {
148-
$this->hydrators[$cacheKey]->hydrate($value);
149-
$this->defaultFlagSetter->unsetFlagFromValue($value);
150-
$this->processedValues[$cacheKey][$index] = $value;
151-
}
142+
if (isset($this->processedValues[$cacheKey][$index])) {
143+
$value = $this->processedValues[$cacheKey][$index];
144+
} elseif (isset($this->hydrators[$cacheKey])
145+
&& $this->hydrators[$cacheKey] instanceof HydratorInterface
146+
) {
147+
$this->hydrators[$cacheKey]->hydrate($value);
148+
$this->defaultFlagSetter->unsetFlagFromValue($value);
149+
$this->processedValues[$cacheKey][$index] = $value;
152150
}
153151
}
154152
}

0 commit comments

Comments
 (0)