Skip to content

Commit

Permalink
document
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Sep 27, 2023
1 parent 2ab49b0 commit 2c0cf1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GlobalId/NodeRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand Down

0 comments on commit 2c0cf1b

Please sign in to comment.