From 2c0cf1b3c67e1294de5ae72c7d433c2a61aa8669 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 27 Sep 2023 11:24:07 +0200 Subject: [PATCH] document --- src/GlobalId/NodeRegistry.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GlobalId/NodeRegistry.php b/src/GlobalId/NodeRegistry.php index c42352df9..32c02db24 100644 --- a/src/GlobalId/NodeRegistry.php +++ b/src/GlobalId/NodeRegistry.php @@ -58,11 +58,11 @@ public function resolve(mixed $root, array $args, GraphQLContext $context, Resol // This check forces Lighthouse to eagerly load the type, which might not have // happened if the client only references it indirectly through an interface. - // Loading the type in turn causes the TypeMiddleware to run and thus register - // the type in the NodeRegistry. + // Loading the type in turn causes the TypeMiddleware to run and thus register the type in the NodeRegistry. $this->typeRegistry->has($decodedType) ?: throw new Error("[{$decodedType}] is not a type and cannot be resolved."); + // We can not continue without a resolver. $resolver = $this->nodeResolverFns[$decodedType] ?? throw new Error("[{$decodedType}] is not a registered node and cannot be resolved.");