We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a1159e commit 99a9297Copy full SHA for 99a9297
src/Serializer.php
@@ -13,6 +13,7 @@ class Serializer
13
private array $map = [];
14
private array $primary = [];
15
private array $deferred = [];
16
+ private array $processedFields = [];
17
18
/**
19
* Add a primary resource to the document.
@@ -68,10 +69,12 @@ private function addToMap(Context $context): array
68
69
}
70
71
foreach ($context->sparseFields($resource) as $field) {
- if (has_value($this->map[$key], $field)) {
72
+ if (in_array($field, $this->processedFields[$key] ?? [])) {
73
continue;
74
75
76
+ $this->processedFields[$key][] = $field;
77
+
78
$fieldContext = $context
79
->withField($field)
80
->withInclude($context->include[$field->name] ?? null);
0 commit comments