6
6
7
7
use GraphQL \Utils \SchemaPrinter ;
8
8
use Overblog \GraphQLBundle \Request \Executor as RequestExecutor ;
9
+ use Overblog \GraphQLBundle \Resolver \TypeResolver ;
9
10
use Symfony \Component \DependencyInjection \Exception \ServiceNotFoundException ;
10
11
use Symfony \Component \HttpFoundation \Request ;
11
12
use Symfony \Component \HttpFoundation \Response ;
@@ -24,14 +25,16 @@ final class ProfilerController
24
25
private ?Profiler $ profiler ;
25
26
private ?Environment $ twig ;
26
27
private string $ endpointUrl ;
28
+ private TypeResolver $ typeResolver ;
27
29
private RequestExecutor $ requestExecutor ;
28
30
private ?string $ queryMatch ;
29
31
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 )
31
33
{
32
34
$ this ->profiler = $ profiler ;
33
35
$ this ->twig = $ twig ;
34
36
$ this ->endpointUrl = $ router ->generate ('overblog_graphql_endpoint ' );
37
+ $ this ->typeResolver = $ typeResolver ;
35
38
$ this ->requestExecutor = $ requestExecutor ;
36
39
$ this ->queryMatch = $ queryMatch ;
37
40
}
@@ -69,9 +72,11 @@ public function __invoke(Request $request, string $token): Response
69
72
}, $ this ->profiler ->find (null , $ this ->queryMatch ?: $ this ->endpointUrl , $ limit , 'POST ' , null , null , null )); // @phpstan-ignore-line
70
73
71
74
$ schemas = [];
75
+ $ this ->typeResolver ->setIgnoreUnresolvableException (true );
72
76
foreach ($ this ->requestExecutor ->getSchemasNames () as $ schemaName ) {
73
77
$ schemas [$ schemaName ] = SchemaPrinter::doPrint ($ this ->requestExecutor ->getSchema ($ schemaName ));
74
78
}
79
+ $ this ->typeResolver ->setIgnoreUnresolvableException (false );
75
80
76
81
return new Response ($ this ->twig ->render ('@OverblogGraphQL/profiler/graphql.html.twig ' , [
77
82
'request ' => $ request ,
0 commit comments