File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,9 @@ fn build_child_filter_from_object(
417
417
fn list_values ( value : Value , filter_type : & str ) -> Result < Vec < Value > , QueryExecutionError > {
418
418
match value {
419
419
Value :: List ( values) => {
420
+ if values. is_empty ( ) {
421
+ return Ok ( values) ;
422
+ }
420
423
// Check that all values in list are of the same type
421
424
let root_discriminant = discriminant ( & values[ 0 ] ) ;
422
425
for value in & values {
@@ -968,6 +971,26 @@ mod tests {
968
971
)
969
972
}
970
973
974
+ #[ test]
975
+ fn build_query_handles_empty_in_list ( ) {
976
+ let query_field = default_field_with (
977
+ "where" ,
978
+ r:: Value :: Object ( Object :: from_iter ( vec ! [ (
979
+ "id_in" . into( ) ,
980
+ r:: Value :: List ( vec![ ] ) ,
981
+ ) ] ) ) ,
982
+ ) ;
983
+
984
+ let result = query ( & query_field) ;
985
+ assert_eq ! (
986
+ result. filter,
987
+ Some ( EntityFilter :: And ( vec![ EntityFilter :: In (
988
+ "id" . to_string( ) ,
989
+ Vec :: <Value >:: new( ) ,
990
+ ) ] ) )
991
+ ) ;
992
+ }
993
+
971
994
#[ test]
972
995
fn build_query_yields_block_change_gte_filter ( ) {
973
996
let query_field = default_field_with (
You can’t perform that action at this time.
0 commit comments