11use super :: cache:: { QueryBlockCache , QueryCache } ;
22use crossbeam:: atomic:: AtomicCell ;
33use graph:: {
4- data:: schema:: META_FIELD_NAME ,
4+ data:: { schema:: META_FIELD_NAME , value :: Object } ,
55 prelude:: { s, CheapClone } ,
66 util:: timed_rw_lock:: TimedMutex ,
77} ;
@@ -11,7 +11,7 @@ use stable_hash::crypto::SetHasher;
1111use stable_hash:: prelude:: * ;
1212use stable_hash:: utils:: stable_hash;
1313use std:: borrow:: ToOwned ;
14- use std:: collections:: { BTreeMap , HashMap , HashSet } ;
14+ use std:: collections:: { HashMap , HashSet } ;
1515use std:: iter;
1616use std:: time:: Instant ;
1717
@@ -128,7 +128,7 @@ impl CacheWeight for WeightedResult {
128128impl Default for WeightedResult {
129129 fn default ( ) -> Self {
130130 WeightedResult {
131- result : Arc :: new ( QueryResult :: new ( BTreeMap :: default ( ) ) ) ,
131+ result : Arc :: new ( QueryResult :: new ( Object :: default ( ) ) ) ,
132132 weight : 0 ,
133133 }
134134 }
@@ -290,7 +290,7 @@ pub fn execute_root_selection_set_uncached(
290290 ctx : & ExecutionContext < impl Resolver > ,
291291 selection_set : & q:: SelectionSet ,
292292 root_type : & s:: ObjectType ,
293- ) -> Result < BTreeMap < String , r :: Value > , Vec < QueryExecutionError > > {
293+ ) -> Result < Object , Vec < QueryExecutionError > > {
294294 // Split the top-level fields into introspection fields and
295295 // regular data fields
296296 let mut data_set = q:: SelectionSet {
@@ -320,7 +320,7 @@ pub fn execute_root_selection_set_uncached(
320320
321321 // If we are getting regular data, prefetch it from the database
322322 let mut values = if data_set. items . is_empty ( ) && meta_items. is_empty ( ) {
323- BTreeMap :: default ( )
323+ Object :: default ( )
324324 } else {
325325 let initial_data = ctx. resolver . prefetch ( & ctx, & data_set) ?;
326326 data_set. items . extend ( meta_items) ;
@@ -506,14 +506,14 @@ fn execute_selection_set_to_map<'a>(
506506 selection_sets : impl Iterator < Item = & ' a q:: SelectionSet > ,
507507 object_type : & s:: ObjectType ,
508508 prefetched_value : Option < r:: Value > ,
509- ) -> Result < BTreeMap < String , r :: Value > , Vec < QueryExecutionError > > {
509+ ) -> Result < Object , Vec < QueryExecutionError > > {
510510 let mut prefetched_object = match prefetched_value {
511511 Some ( r:: Value :: Object ( object) ) => Some ( object) ,
512512 Some ( _) => unreachable ! ( ) ,
513513 None => None ,
514514 } ;
515515 let mut errors: Vec < QueryExecutionError > = Vec :: new ( ) ;
516- let mut result_map: BTreeMap < String , r :: Value > = BTreeMap :: new ( ) ;
516+ let mut result_map = Object :: new ( ) ;
517517
518518 // Group fields with the same response key, so we can execute them together
519519 let grouped_field_set = collect_fields ( ctx, object_type, selection_sets) ;
@@ -1063,7 +1063,7 @@ pub fn coerce_argument_values<'a>(
10631063 if argument_def. name == "text" . to_string ( ) {
10641064 coerced_values. insert (
10651065 argument_def. name . as_str ( ) ,
1066- r:: Value :: Object ( BTreeMap :: from_iter ( vec ! [ ( field. name. clone( ) , value) ] ) ) ,
1066+ r:: Value :: Object ( Object :: from_iter ( vec ! [ ( field. name. clone( ) , value) ] ) ) ,
10671067 ) ;
10681068 } else {
10691069 coerced_values. insert ( & argument_def. name , value) ;
0 commit comments