Skip to content

Commit 2dfc47b

Browse files
committed
Performance -> Moving getfields down the graph for apps that don't use the Document field.
1 parent 7a54993 commit 2dfc47b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Plugin/GraphQL/Fields/SearchAPIDocuments.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class SearchAPIDocuments extends FieldPluginBase {
2525
public function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) {
2626
if (isset($value['SearchAPIDocument'])) {
2727
foreach ($value['SearchAPIDocument'] as $doc) {
28+
$doc['item'] = $doc['item']->getFields();
2829
yield $doc;
2930
}
3031
}

src/Plugin/GraphQL/Fields/SearchAPISearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ private function getSearchResponse($results) {
341341
// Loop through each item in the result set.
342342
foreach ($result_items as $id => &$item) {
343343
// Load the response document into the search response array.
344-
$document['item'] = $item->getFields();
344+
$document['item'] = $item;
345345
$document['index_id'] = $this->index->id();
346346
$document['type'] = str_replace("_", "", ucwords($this->index->id() . "Doc", '_'));
347347

0 commit comments

Comments
 (0)