@@ -123,7 +123,7 @@ impl<S: Store> IndexNodeResolver<S> {
123123 }
124124
125125 fn resolve_indexing_statuses ( & self , field : & a:: Field ) -> Result < r:: Value , QueryExecutionError > {
126- let deployments: Vec < String > = field
126+ let deployments = field
127127 . argument_value ( "subgraphs" )
128128 . map ( |value| match value {
129129 r:: Value :: List ( ids) => ids
@@ -135,7 +135,7 @@ impl<S: Store> IndexNodeResolver<S> {
135135 . collect ( ) ,
136136 _ => unreachable ! ( ) ,
137137 } )
138- . unwrap ( ) ;
138+ . unwrap_or_else ( Vec :: new ) ;
139139
140140 if deployments. is_empty ( ) {
141141 return Ok ( r:: Value :: List ( vec ! [ ] ) ) ;
@@ -171,35 +171,6 @@ impl<S: Store> IndexNodeResolver<S> {
171171 Ok ( infos. into_value ( ) )
172172 }
173173
174- fn resolve_indexing_status_for_version (
175- & self ,
176- field : & a:: Field ,
177-
178- // If `true` return the current version, if `false` return the pending version.
179- current_version : bool ,
180- ) -> Result < r:: Value , QueryExecutionError > {
181- // We can safely unwrap because the argument is non-nullable and has been validated.
182- let subgraph_name = field. get_required :: < String > ( "subgraphName" ) . unwrap ( ) ;
183-
184- debug ! (
185- self . logger,
186- "Resolve indexing status for subgraph name" ;
187- "name" => & subgraph_name,
188- "current_version" => current_version,
189- ) ;
190-
191- let infos = self . store . status ( status:: Filter :: SubgraphVersion (
192- subgraph_name,
193- current_version,
194- ) ) ?;
195-
196- Ok ( infos
197- . into_iter ( )
198- . next ( )
199- . map ( |info| info. into_value ( ) )
200- . unwrap_or ( r:: Value :: Null ) )
201- }
202-
203174 fn resolve_entity_changes_in_block (
204175 & self ,
205176 field : & a:: Field ,
@@ -472,6 +443,35 @@ impl<S: Store> IndexNodeResolver<S> {
472443 Ok ( r:: Value :: List ( public_poi_results) )
473444 }
474445
446+ fn resolve_indexing_status_for_version (
447+ & self ,
448+ field : & a:: Field ,
449+
450+ // If `true` return the current version, if `false` return the pending version.
451+ current_version : bool ,
452+ ) -> Result < r:: Value , QueryExecutionError > {
453+ // We can safely unwrap because the argument is non-nullable and has been validated.
454+ let subgraph_name = field. get_required :: < String > ( "subgraphName" ) . unwrap ( ) ;
455+
456+ debug ! (
457+ self . logger,
458+ "Resolve indexing status for subgraph name" ;
459+ "name" => & subgraph_name,
460+ "current_version" => current_version,
461+ ) ;
462+
463+ let infos = self . store . status ( status:: Filter :: SubgraphVersion (
464+ subgraph_name,
465+ current_version,
466+ ) ) ?;
467+
468+ Ok ( infos
469+ . into_iter ( )
470+ . next ( )
471+ . map ( |info| info. into_value ( ) )
472+ . unwrap_or ( r:: Value :: Null ) )
473+ }
474+
475475 async fn validate_and_extract_features < C , SgStore > (
476476 subgraph_store : & Arc < SgStore > ,
477477 unvalidated_subgraph_manifest : UnvalidatedSubgraphManifest < C > ,
0 commit comments