@@ -82,7 +82,8 @@ public function getItemQueryFields(string $resourceClass, Operation $operation,
82
82
83
83
if ($ fieldConfiguration = $ this ->getResourceFieldConfiguration (null , $ operation ->getDescription (), $ operation ->getDeprecationReason (), new Type (Type::BUILTIN_TYPE_OBJECT , true , $ resourceClass ), $ resourceClass , false , $ operation )) {
84
84
$ args = $ this ->resolveResourceArgs ($ configuration ['args ' ] ?? [], $ operation );
85
- $ configuration ['args ' ] = $ args ?: $ configuration ['args ' ] ?? ['id ' => ['type ' => GraphQLType::nonNull (GraphQLType::id ())]];
85
+ $ extraArgs = $ this ->resolveResourceArgs ($ operation ->getExtraArgs () ?? [], $ operation );
86
+ $ configuration ['args ' ] = $ args ?: $ configuration ['args ' ] ?? ['id ' => ['type ' => GraphQLType::nonNull (GraphQLType::id ())]] + $ extraArgs ;
86
87
87
88
return [$ fieldName => array_merge ($ fieldConfiguration , $ configuration )];
88
89
}
@@ -103,7 +104,8 @@ public function getCollectionQueryFields(string $resourceClass, Operation $opera
103
104
104
105
if ($ fieldConfiguration = $ this ->getResourceFieldConfiguration (null , $ operation ->getDescription (), $ operation ->getDeprecationReason (), new Type (Type::BUILTIN_TYPE_OBJECT , false , null , true , null , new Type (Type::BUILTIN_TYPE_OBJECT , false , $ resourceClass )), $ resourceClass , false , $ operation )) {
105
106
$ args = $ this ->resolveResourceArgs ($ configuration ['args ' ] ?? [], $ operation );
106
- $ configuration ['args ' ] = $ args ?: $ configuration ['args ' ] ?? $ fieldConfiguration ['args ' ];
107
+ $ extraArgs = $ this ->resolveResourceArgs ($ operation ->getExtraArgs () ?? [], $ operation );
108
+ $ configuration ['args ' ] = $ args ?: $ configuration ['args ' ] ?? $ fieldConfiguration ['args ' ] + $ extraArgs ;
107
109
108
110
return [Inflector::pluralize ($ fieldName ) => array_merge ($ fieldConfiguration , $ configuration )];
109
111
}
@@ -195,7 +197,7 @@ public function getResourceObjectTypeFields(?string $resourceClass, Operation $o
195
197
return $ fields ;
196
198
}
197
199
198
- if (!$ input || (' create ' !== $ operation ->getName () && ! $ operation ->getInput ())) {
200
+ if (!$ input || (! $ operation ->getResolver () && ' create ' !== $ operation ->getName ())) {
199
201
$ fields ['id ' ] = $ idField ;
200
202
}
201
203
if ($ input && $ depth >= 1 ) {
0 commit comments