File tree Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Original file line number Diff line number Diff line change 44
55namespace Overblog \GraphQLBundle \Definition \Type ;
66
7- use GraphQL \Type \Definition \Type ;
87use GraphQL \Type \Schema ;
98use GraphQL \Type \SchemaConfig ;
109use Overblog \GraphQLBundle \Definition \Type \SchemaExtension \SchemaExtensionInterface ;
11- use Overblog \GraphQLBundle \Resolver \UnresolvableException ;
1210
1311class ExtensibleSchema extends Schema
1412{
1513 public function __construct ($ config )
1614 {
17- parent ::__construct ($ this -> addDefaultFallBackToTypeLoader (
15+ parent ::__construct (
1816 $ config instanceof SchemaConfig ? $ config : SchemaConfig::create ($ config )
19- )) ;
17+ );
2018 }
2119
2220 /** @var SchemaExtensionInterface[] */
@@ -53,28 +51,4 @@ public function processExtensions()
5351
5452 return $ this ;
5553 }
56-
57- private function addDefaultFallBackToTypeLoader (SchemaConfig $ schemaConfig ): SchemaConfig
58- {
59- $ typeLoader = $ schemaConfig ->typeLoader ;
60- $ loaderWrapper = null ;
61- $ loaderWrapper = function ($ name ) use ($ typeLoader , &$ schemaConfig , &$ loaderWrapper ): ?Type {
62- $ type = null ;
63- try {
64- $ type = $ typeLoader ($ name );
65- } catch (UnresolvableException $ e ) {
66- // second chance for types with un-registered name in TypeResolver
67- // we disabled the custom typeLoader to force default loader usage
68- $ schemaConfig ->typeLoader = null ;
69- $ type = $ this ->getType ($ name );
70- $ schemaConfig ->typeLoader = $ loaderWrapper ; // @phpstan-ignore-line
71- }
72-
73- return $ type ;
74- };
75-
76- $ schemaConfig ->typeLoader = $ loaderWrapper ; // @phpstan-ignore-line
77-
78- return $ schemaConfig ;
79- }
8054}
You can’t perform that action at this time.
0 commit comments