src/Schema/NodeRegistry.php
public function resolve($rootValue, array $args, GraphQLContext $context, ResolveInfo $resolveInfo)
    {
        [$decodedType, $decodedId] = $args['id'];

        // Check if we have a resolver registered for the given type
        if (! $resolver = Arr::get($this->nodeResolver, $decodedType)) {
            throw new Error("[{$decodedType}] is not a registered node and cannot be resolved.");
        }

        // Stash the decoded type, as it will later be used to determine the correct return type of the node query
        $this->currentType = $decodedType;

        return $resolver($decodedId, $context, $resolveInfo);
    }
public function resolve($rootValue, array $args, GraphQLContext $context, ResolveInfo $resolveInfo)
    {
        [$decodedType, $decodedId] = $args['id'];

        // Check if we have a resolver registered for the given type
        if (! $resolver = Arr::get($this->nodeResolver, $decodedType)) {
            throw new Error("[{$decodedType}] is not a registered node and cannot be resolved.");
        }

        // Stash the decoded type, as it will later be used to determine the correct return type of the node query
        $this->currentType = $decodedType;

        return $resolver($decodedId, $context, $resolveInfo);
    }
public function resolve ( $ rootValue , array $ args , GraphQLContext $ context , ResolveInfo $ resolveInfo ) { [ $ decodedType , $ decodedId ] = $ args [ 'id' ] ; // Check if we have a resolver registered for the given type if ( ! $ resolver = Arr :: get ( $ this -> nodeResolver , $ decodedType ) ) { throw new Error ( "[{$decodedType}] is not a registered node and cannot be resolved." ) ; } // Stash the decoded type, as it will later be used to determine the correct return type of the node query $ this -> currentType = $ decodedType ; return $ resolver ( $ decodedId , $ context , $ resolveInfo ) ; }
Get the appropriate resolver for the node and call it with the decoded id.

@param  mixed|null  $rootValue
@param  array  $args
@param  \Nuwave\Lighthouse\Support\Contracts\GraphQLContext  $context
@param  \GraphQL\Type\Definition\ResolveInfo  $resolveInfo
@return mixed

@throws \GraphQL\Error\Error
Get the appropriate resolver for the node and call it with the decoded id .