From e865e9b3f08c6359106bd693338207e74b23a338 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Thu, 23 Mar 2023 14:14:53 +0100 Subject: [PATCH] IBX-5329: Fixed empty field resolving in GraphQL (#66) --- src/GraphQL/QueryFieldResolver.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GraphQL/QueryFieldResolver.php b/src/GraphQL/QueryFieldResolver.php index f1b3b36..d2b17b3 100644 --- a/src/GraphQL/QueryFieldResolver.php +++ b/src/GraphQL/QueryFieldResolver.php @@ -27,8 +27,12 @@ public function resolveQueryField(Field $field, Content $content) return $this->queryFieldService->loadContentItems($content, $field->fieldDefIdentifier); } - public function resolveQueryFieldConnection(Argument $args, Field $field, Content $content) + public function resolveQueryFieldConnection(Argument $args, ?Field $field, Content $content) { + if ($field === null) { + return null; + } + if (!isset($args['first'])) { $args['first'] = $this->queryFieldService->getPaginationConfiguration($content, $field->fieldDefIdentifier); }