1919use TheCodingMachine \GraphQLite \Hydrators \HydratorInterface ;
2020use TheCodingMachine \GraphQLite \Mappers \CannotMapTypeExceptionInterface ;
2121use TheCodingMachine \GraphQLite \Reflection \CachedDocBlockFactory ;
22+ use TheCodingMachine \GraphQLite \Types \ArgumentResolver ;
2223use TheCodingMachine \GraphQLite \Types \CustomTypesRegistry ;
2324use TheCodingMachine \GraphQLite \Types \ID ;
2425use TheCodingMachine \GraphQLite \Types \TypeResolver ;
@@ -65,9 +66,9 @@ class FieldsBuilder
6566 */
6667 private $ typeMapper ;
6768 /**
68- * @var HydratorInterface
69+ * @var ArgumentResolver
6970 */
70- private $ hydrator ;
71+ private $ argumentResolver ;
7172 /**
7273 * @var AuthenticationServiceInterface
7374 */
@@ -90,13 +91,13 @@ class FieldsBuilder
9091 private $ namingStrategy ;
9192
9293 public function __construct (AnnotationReader $ annotationReader , RecursiveTypeMapperInterface $ typeMapper ,
93- HydratorInterface $ hydrator , AuthenticationServiceInterface $ authenticationService ,
94+ ArgumentResolver $ argumentResolver , AuthenticationServiceInterface $ authenticationService ,
9495 AuthorizationServiceInterface $ authorizationService , TypeResolver $ typeResolver ,
9596 CachedDocBlockFactory $ cachedDocBlockFactory , NamingStrategyInterface $ namingStrategy )
9697 {
9798 $ this ->annotationReader = $ annotationReader ;
9899 $ this ->typeMapper = $ typeMapper ;
99- $ this ->hydrator = $ hydrator ;
100+ $ this ->argumentResolver = $ argumentResolver ;
100101 $ this ->authenticationService = $ authenticationService ;
101102 $ this ->authorizationService = $ authorizationService ;
102103 $ this ->typeResolver = $ typeResolver ;
@@ -266,13 +267,13 @@ private function getFieldsByAnnotations($controller, string $annotationName, boo
266267 if ($ failWithValue === null && $ type instanceof NonNull) {
267268 $ type = $ type ->getWrappedType ();
268269 }
269- $ queryList [] = new QueryField ($ name , $ type , $ args , $ callable , null , $ this ->hydrator , $ docBlockComment , $ injectSource );
270+ $ queryList [] = new QueryField ($ name , $ type , $ args , $ callable , null , $ this ->argumentResolver , $ docBlockComment , $ injectSource );
270271 } else {
271272 $ callable = [$ controller , $ methodName ];
272273 if ($ sourceClassName !== null ) {
273- $ queryList [] = new QueryField ($ name , $ type , $ args , null , $ callable [1 ], $ this ->hydrator , $ docBlockComment , $ injectSource );
274+ $ queryList [] = new QueryField ($ name , $ type , $ args , null , $ callable [1 ], $ this ->argumentResolver , $ docBlockComment , $ injectSource );
274275 } else {
275- $ queryList [] = new QueryField ($ name , $ type , $ args , $ callable , null , $ this ->hydrator , $ docBlockComment , $ injectSource );
276+ $ queryList [] = new QueryField ($ name , $ type , $ args , $ callable , null , $ this ->argumentResolver , $ docBlockComment , $ injectSource );
276277 }
277278 }
278279 }
@@ -392,7 +393,7 @@ private function getQueryFieldsFromSourceFields(array $sourceFields, ReflectionC
392393 }
393394
394395 if (!$ unauthorized ) {
395- $ queryList [] = new QueryField ($ sourceField ->getName (), $ type , $ args , null , $ methodName , $ this ->hydrator , $ docBlockComment , false );
396+ $ queryList [] = new QueryField ($ sourceField ->getName (), $ type , $ args , null , $ methodName , $ this ->argumentResolver , $ docBlockComment , false );
396397 } else {
397398 $ failWithValue = $ sourceField ->getFailWith ();
398399 $ callable = function () use ($ failWithValue ) {
@@ -401,7 +402,7 @@ private function getQueryFieldsFromSourceFields(array $sourceFields, ReflectionC
401402 if ($ failWithValue === null && $ type instanceof NonNull) {
402403 $ type = $ type ->getWrappedType ();
403404 }
404- $ queryList [] = new QueryField ($ sourceField ->getName (), $ type , $ args , $ callable , null , $ this ->hydrator , $ docBlockComment , false );
405+ $ queryList [] = new QueryField ($ sourceField ->getName (), $ type , $ args , $ callable , null , $ this ->argumentResolver , $ docBlockComment , false );
405406 }
406407
407408 }
0 commit comments