Skip to content

Commit f70c3a1

Browse files
committed
Enhancment: Adds Limit
1 parent 7176039 commit f70c3a1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Resolver/StoryResolver.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ public function resolve(array $target, array $relations): array
2424
{
2525
$relationMap = [];
2626

27-
foreach ($relations as $relation) {
27+
foreach ($relations as $key => $relation) {
2828
Assert::keyExists($relation, 'uuid');
2929
Assert::uuid($relation['uuid']);
3030
$relationMap[$relation['uuid']] = $relation;
31+
32+
// There is a limit of possible resolvable relations.
33+
// @see https://www.storyblok.com/docs/api/content-delivery/v2/stories/retrieve-a-single-story
34+
if (50 === $key) {
35+
break;
36+
}
3137
}
3238

3339
foreach ($target as &$value) {

0 commit comments

Comments
 (0)