1
1
use super :: cache:: QueryCache ;
2
+ use crossbeam:: atomic:: AtomicCell ;
2
3
use graph:: prelude:: CheapClone ;
3
4
use graphql_parser:: query as q;
4
5
use graphql_parser:: schema as s;
@@ -8,11 +9,10 @@ use stable_hash::crypto::SetHasher;
8
9
use stable_hash:: prelude:: * ;
9
10
use stable_hash:: utils:: stable_hash;
10
11
use std:: collections:: { BTreeMap , HashMap , HashSet , VecDeque } ;
12
+ use std:: fmt;
11
13
use std:: iter;
12
14
use std:: sync:: RwLock ;
13
15
use std:: time:: Instant ;
14
- use std:: fmt;
15
- use crossbeam:: atomic:: AtomicCell ;
16
16
17
17
use graph:: prelude:: * ;
18
18
@@ -26,8 +26,6 @@ use crate::values::coercion;
26
26
27
27
type QueryHash = <SetHasher as StableHasher >:: Out ;
28
28
29
- pub ( crate ) type QueryResponse = Result < BTreeMap < String , q:: Value > , Vec < QueryExecutionError > > ;
30
-
31
29
#[ derive( Debug ) ]
32
30
struct CacheByBlock {
33
31
block : EthereumBlockPointer ,
@@ -199,7 +197,7 @@ impl fmt::Display for CacheStatus {
199
197
CacheStatus :: Hit => f. write_str ( "hit" ) ,
200
198
CacheStatus :: Shared => f. write_str ( "shared" ) ,
201
199
CacheStatus :: Insert => f. write_str ( "insert" ) ,
202
- CacheStatus :: Miss => f. write_str ( "miss" )
200
+ CacheStatus :: Miss => f. write_str ( "miss" ) ,
203
201
}
204
202
}
205
203
}
@@ -271,7 +269,7 @@ pub fn execute_root_selection_set_uncached(
271
269
ctx : & ExecutionContext < impl Resolver > ,
272
270
selection_set : & q:: SelectionSet ,
273
271
root_type : & s:: ObjectType ,
274
- ) -> QueryResponse {
272
+ ) -> Result < BTreeMap < String , q :: Value > , Vec < QueryExecutionError > > {
275
273
// Split the top-level fields into introspection fields and
276
274
// regular data fields
277
275
let mut data_set = q:: SelectionSet {
@@ -442,7 +440,7 @@ fn execute_selection_set_to_map<'a>(
442
440
selection_sets : impl Iterator < Item = & ' a q:: SelectionSet > ,
443
441
object_type : & s:: ObjectType ,
444
442
prefetched_value : Option < q:: Value > ,
445
- ) -> QueryResponse {
443
+ ) -> Result < BTreeMap < String , q :: Value > , Vec < QueryExecutionError > > {
446
444
let mut prefetched_object = match prefetched_value {
447
445
Some ( q:: Value :: Object ( object) ) => Some ( object) ,
448
446
Some ( _) => unreachable ! ( ) ,
0 commit comments