@@ -562,8 +562,8 @@ function g.test_custom_type_scalar_variables()
562562 if args .field == nil then
563563 return nil
564564 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!" )
567567 return args .field
568568 end
569569 },
@@ -576,6 +576,20 @@ function g.test_custom_type_scalar_variables()
576576 return args .fields [1 ]
577577 end
578578 },
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+ },
579593 [' test_custom_type_scalar_inputObject' ] = {
580594 kind = types .string ,
581595 arguments = {
@@ -617,6 +631,16 @@ function g.test_custom_type_scalar_variables()
617631 variables = {field = box .NULL },
618632 }), {test_json_type = ' null' })
619633
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+
620644 t .assert_equals (check_request ([[
621645 query {
622646 test_json_type(
0 commit comments