@@ -562,8 +562,8 @@ function g.test_custom_type_scalar_variables()
562
562
if args .field == nil then
563
563
return nil
564
564
end
565
- assert ( type ( args .field ) == ' table' , " Field is not a table! " )
566
- assert (args .field .test ~= nil , " No field 'test' in object!" )
565
+ t . assert_type ( args .field , ' table' , " Field is not a table! " )
566
+ t . assert_not_equals (args .field .test , nil , " No field 'test' in object!" )
567
567
return args .field
568
568
end
569
569
},
@@ -576,6 +576,20 @@ function g.test_custom_type_scalar_variables()
576
576
return args .fields [1 ]
577
577
end
578
578
},
579
+ [' test_json_type_list' ] = {
580
+ arguments = {
581
+ array = types .list (json_type ),
582
+ },
583
+ kind = types .list (json_type ),
584
+ resolve = function (_ , args )
585
+ if args .array == nil then
586
+ return nil
587
+ end
588
+ t .assert_type (args .array [1 ], ' table' , " Array element is not a table! " )
589
+ t .assert_not_equals (args .array [1 ].test , nil , " No field 'test' in array element!" )
590
+ return args .array
591
+ end
592
+ },
579
593
[' test_custom_type_scalar_inputObject' ] = {
580
594
kind = types .string ,
581
595
arguments = {
@@ -617,6 +631,16 @@ function g.test_custom_type_scalar_variables()
617
631
variables = {field = box .NULL },
618
632
}), {test_json_type = ' null' })
619
633
634
+ t .assert_equals (check_request ([[
635
+ query($array: [Json]) {
636
+ test_json_type_list(
637
+ array: $array
638
+ )
639
+ }
640
+ ]] , query_schema , nil , nil , {
641
+ variables = {array = {json .encode ({test = 123 })}},
642
+ }), {test_json_type_list = {' {"test":123}' }})
643
+
620
644
t .assert_equals (check_request ([[
621
645
query {
622
646
test_json_type(
0 commit comments