66
77use GraphQL \Utils \SchemaPrinter ;
88use Overblog \GraphQLBundle \Request \Executor as RequestExecutor ;
9+ use Overblog \GraphQLBundle \Resolver \TypeResolver ;
910use Symfony \Component \DependencyInjection \Exception \ServiceNotFoundException ;
1011use Symfony \Component \HttpFoundation \Request ;
1112use Symfony \Component \HttpFoundation \Response ;
@@ -24,14 +25,16 @@ final class ProfilerController
2425 private ?Profiler $ profiler ;
2526 private ?Environment $ twig ;
2627 private string $ endpointUrl ;
28+ private TypeResolver $ typeResolver ;
2729 private RequestExecutor $ requestExecutor ;
2830 private ?string $ queryMatch ;
2931
30- public function __construct (?Profiler $ profiler , ?Environment $ twig , RouterInterface $ router , RequestExecutor $ requestExecutor , ?string $ queryMatch )
32+ public function __construct (?Profiler $ profiler , ?Environment $ twig , RouterInterface $ router , TypeResolver $ typeResolver , RequestExecutor $ requestExecutor , ?string $ queryMatch )
3133 {
3234 $ this ->profiler = $ profiler ;
3335 $ this ->twig = $ twig ;
3436 $ this ->endpointUrl = $ router ->generate ('overblog_graphql_endpoint ' );
37+ $ this ->typeResolver = $ typeResolver ;
3538 $ this ->requestExecutor = $ requestExecutor ;
3639 $ this ->queryMatch = $ queryMatch ;
3740 }
@@ -69,9 +72,11 @@ public function __invoke(Request $request, string $token): Response
6972 }, $ this ->profiler ->find (null , $ this ->queryMatch ?: $ this ->endpointUrl , $ limit , 'POST ' , null , null , null )); // @phpstan-ignore-line
7073
7174 $ schemas = [];
75+ $ this ->typeResolver ->setIgnoreUnresolvableException (true );
7276 foreach ($ this ->requestExecutor ->getSchemasNames () as $ schemaName ) {
7377 $ schemas [$ schemaName ] = SchemaPrinter::doPrint ($ this ->requestExecutor ->getSchema ($ schemaName ));
7478 }
79+ $ this ->typeResolver ->setIgnoreUnresolvableException (false );
7580
7681 return new Response ($ this ->twig ->render ('@OverblogGraphQL/profiler/graphql.html.twig ' , [
7782 'request ' => $ request ,
0 commit comments