File tree Expand file tree Collapse file tree
crates/deno-subsystem/deno-graphql-resolver/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ pub async fn construct_arg_sequence<'a>(
229229 } )
230230 . collect :: < HashMap < _ , _ > > ( ) ;
231231
232- futures:: stream:: iter ( args. iter ( ) )
232+ let mut resolved_args = futures:: stream:: iter ( args. iter ( ) )
233233 . then ( |arg| async {
234234 if arg. is_injected {
235235 // handle injected arguments
@@ -312,5 +312,15 @@ pub async fn construct_arg_sequence<'a>(
312312 . collect :: < Vec < Result < _ , _ > > > ( )
313313 . await
314314 . into_iter ( )
315- . collect :: < Result < _ , _ > > ( )
315+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
316+
317+ // Append a final argument that contains all non-injected args as a single object.
318+ // This keeps existing positional args intact while giving Deno resolvers a stable args map.
319+ let mut args_object = serde_json:: Map :: new ( ) ;
320+ for ( key, value) in mapped_args. into_iter ( ) {
321+ args_object. insert ( key, value) ;
322+ }
323+ resolved_args. push ( Arg :: Serde ( serde_json:: Value :: Object ( args_object) ) ) ;
324+
325+ Ok ( resolved_args)
316326}
You can’t perform that action at this time.
0 commit comments