@@ -771,7 +771,7 @@ fn execute_field(
771
771
field : & q:: Field ,
772
772
field_definition : & s:: Field ,
773
773
) -> Result < Vec < Node > , Vec < QueryExecutionError > > {
774
- let mut argument_values = match object_type {
774
+ let argument_values = match object_type {
775
775
ObjectOrInterface :: Object ( object_type) => {
776
776
crate :: execution:: coerce_argument_values ( ctx, object_type, field)
777
777
}
@@ -797,31 +797,13 @@ fn execute_field(
797
797
}
798
798
} ?;
799
799
800
- let is_list = sast:: is_list_or_non_null_list_field ( field_definition) ;
801
- if !argument_values. contains_key ( & * ARG_FIRST ) {
802
- let first = if is_list {
803
- // This makes `build_range` use the default, 100
804
- q:: Value :: Null
805
- } else {
806
- // For non-list fields, get up to 2 entries so we can spot
807
- // ambiguous references that should only have one entry
808
- q:: Value :: Int ( 2 . into ( ) )
809
- } ;
810
- argument_values. insert ( & * ARG_FIRST , first) ;
811
- }
812
-
813
- if !argument_values. contains_key ( & * ARG_SKIP ) {
814
- // Use the default in build_range
815
- argument_values. insert ( & * ARG_SKIP , q:: Value :: Null ) ;
816
- }
817
-
818
800
fetch (
819
801
ctx. logger . clone ( ) ,
820
802
resolver. store . as_ref ( ) ,
821
803
& parents,
822
804
& join,
823
- & argument_values,
824
- is_list ,
805
+ argument_values,
806
+ sast :: is_list_or_non_null_list_field ( field_definition ) ,
825
807
ctx. query . schema . types_for_interface ( ) ,
826
808
resolver. block ,
827
809
ctx. max_first ,
@@ -836,16 +818,33 @@ fn fetch<S: Store>(
836
818
store : & S ,
837
819
parents : & Vec < Node > ,
838
820
join : & Join < ' _ > ,
839
- arguments : & HashMap < & q:: Name , q:: Value > ,
821
+ mut arguments : HashMap < & q:: Name , q:: Value > ,
840
822
is_list : bool ,
841
823
types_for_interface : & BTreeMap < s:: Name , Vec < s:: ObjectType > > ,
842
824
block : BlockNumber ,
843
825
max_first : u32 ,
844
826
) -> Result < Vec < Node > , QueryExecutionError > {
827
+ if !arguments. contains_key ( & * ARG_FIRST ) {
828
+ let first = if is_list {
829
+ // This makes `build_range` use the default, 100
830
+ q:: Value :: Null
831
+ } else {
832
+ // For non-list fields, get up to 2 entries so we can spot
833
+ // ambiguous references that should only have one entry
834
+ q:: Value :: Int ( 2 . into ( ) )
835
+ } ;
836
+ arguments. insert ( & * ARG_FIRST , first) ;
837
+ }
838
+
839
+ if !arguments. contains_key ( & * ARG_SKIP ) {
840
+ // Use the default in build_range
841
+ arguments. insert ( & * ARG_SKIP , q:: Value :: Null ) ;
842
+ }
843
+
845
844
let mut query = build_query (
846
845
join. child_type ,
847
846
block,
848
- arguments,
847
+ & arguments,
849
848
types_for_interface,
850
849
max_first,
851
850
) ?;
0 commit comments