11use crate :: {
2- GraphQLError :: ValidationError ,
32 GraphQLInputObject , GraphQLScalar , InputValue , ScalarValue , Value ,
43 executor:: Variables ,
54 graphql_object, graphql_value, graphql_vars,
@@ -281,10 +280,11 @@ async fn variable_error_on_nested_non_null() {
281280
282281 assert_eq ! (
283282 error,
284- ValidationError ( vec! [ RuleError :: new(
283+ RuleError :: new(
285284 r#"Variable "$input" got invalid value. In field "c": Expected "String!", found null."# ,
286285 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
287- ) ] ) ,
286+ )
287+ . into( ) ,
288288 ) ;
289289}
290290
@@ -305,10 +305,10 @@ async fn variable_error_on_incorrect_type() {
305305
306306 assert_eq ! (
307307 error,
308- ValidationError ( vec! [ RuleError :: new(
308+ RuleError :: new(
309309 r#"Variable "$input" got invalid value. Expected "TestInputObject", found not an object."# ,
310310 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
311- ) ] ) ,
311+ ) . into ( ) ,
312312 ) ;
313313}
314314
@@ -334,10 +334,11 @@ async fn variable_error_on_omit_non_null() {
334334
335335 assert_eq ! (
336336 error,
337- ValidationError ( vec! [ RuleError :: new(
337+ RuleError :: new(
338338 r#"Variable "$input" got invalid value. In field "c": Expected "String!", found null."# ,
339339 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
340- ) ] ) ,
340+ )
341+ . into( ) ,
341342 ) ;
342343}
343344
@@ -363,7 +364,7 @@ async fn variable_multiple_errors_with_nesting() {
363364
364365 assert_eq ! (
365366 error,
366- ValidationError ( vec![
367+ vec![
367368 RuleError :: new(
368369 r#"Variable "$input" got invalid value. In field "na": In field "c": Expected "String!", found null."# ,
369370 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
@@ -372,7 +373,7 @@ async fn variable_multiple_errors_with_nesting() {
372373 r#"Variable "$input" got invalid value. In field "nb": Expected "String!", found null."# ,
373374 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
374375 ) ,
375- ] ) ,
376+ ] . into ( ) ,
376377 ) ;
377378}
378379
@@ -400,10 +401,11 @@ async fn variable_error_on_additional_field() {
400401
401402 assert_eq ! (
402403 error,
403- ValidationError ( vec! [ RuleError :: new(
404+ RuleError :: new(
404405 r#"Variable "$input" got invalid value. In field "extra": Unknown field."# ,
405406 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
406- ) ] ) ,
407+ )
408+ . into( ) ,
407409 ) ;
408410}
409411
@@ -510,10 +512,11 @@ async fn does_not_allow_non_nullable_input_to_be_omitted_in_variable() {
510512
511513 assert_eq ! (
512514 error,
513- ValidationError ( vec! [ RuleError :: new(
515+ RuleError :: new(
514516 r#"Variable "$value" of required type "String!" was not provided."# ,
515517 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
516- ) ] ) ,
518+ )
519+ . into( ) ,
517520 ) ;
518521}
519522
@@ -534,10 +537,11 @@ async fn does_not_allow_non_nullable_input_to_be_set_to_null_in_variable() {
534537
535538 assert_eq ! (
536539 error,
537- ValidationError ( vec! [ RuleError :: new(
540+ RuleError :: new(
538541 r#"Variable "$value" of required type "String!" was not provided."# ,
539542 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
540- ) ] ) ,
543+ )
544+ . into( ) ,
541545 ) ;
542546}
543547
@@ -632,10 +636,11 @@ async fn does_not_allow_non_null_lists_to_be_null() {
632636
633637 assert_eq ! (
634638 error,
635- ValidationError ( vec! [ RuleError :: new(
639+ RuleError :: new(
636640 r#"Variable "$input" of required type "[String]!" was not provided."# ,
637641 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
638- ) ] ) ,
642+ )
643+ . into( ) ,
639644 ) ;
640645}
641646
@@ -715,10 +720,10 @@ async fn does_not_allow_lists_of_non_null_to_contain_null() {
715720
716721 assert_eq ! (
717722 error,
718- ValidationError ( vec! [ RuleError :: new(
723+ RuleError :: new(
719724 r#"Variable "$input" got invalid value. In element #1: Expected "String!", found null."# ,
720725 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
721- ) ] ) ,
726+ ) . into ( ) ,
722727 ) ;
723728}
724729
@@ -739,10 +744,10 @@ async fn does_not_allow_non_null_lists_of_non_null_to_contain_null() {
739744
740745 assert_eq ! (
741746 error,
742- ValidationError ( vec! [ RuleError :: new(
747+ RuleError :: new(
743748 r#"Variable "$input" got invalid value. In element #1: Expected "String!", found null."# ,
744749 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
745- ) ] ) ,
750+ ) . into ( ) ,
746751 ) ;
747752}
748753
@@ -763,10 +768,11 @@ async fn does_not_allow_non_null_lists_of_non_null_to_be_null() {
763768
764769 assert_eq ! (
765770 error,
766- ValidationError ( vec! [ RuleError :: new(
771+ RuleError :: new(
767772 r#"Variable "$input" of required type "[String!]!" was not provided."# ,
768773 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
769- ) ] ) ,
774+ )
775+ . into( ) ,
770776 ) ;
771777}
772778
@@ -915,11 +921,12 @@ async fn does_not_allow_missing_required_field() {
915921
916922 assert_eq ! (
917923 error,
918- ValidationError ( vec! [ RuleError :: new(
924+ RuleError :: new(
919925 "Invalid value for argument \" arg\" , \
920926 reason: \" ExampleInputObject\" is missing fields: \" b\" ",
921927 & [ SourcePosition :: new( 20 , 0 , 20 ) ] ,
922- ) ] ) ,
928+ )
929+ . into( ) ,
923930 ) ;
924931}
925932
@@ -940,12 +947,13 @@ async fn does_not_allow_null_in_required_field() {
940947
941948 assert_eq ! (
942949 error,
943- ValidationError ( vec! [ RuleError :: new(
950+ RuleError :: new(
944951 "Invalid value for argument \" arg\" , \
945952 reason: Error on \" ExampleInputObject\" field \" b\" : \
946953 \" null\" specified for not nullable type \" Int!\" ",
947954 & [ SourcePosition :: new( 20 , 0 , 20 ) ] ,
948- ) ] ) ,
955+ )
956+ . into( ) ,
949957 ) ;
950958}
951959
@@ -966,10 +974,11 @@ async fn does_not_allow_missing_variable_for_required_field() {
966974
967975 assert_eq ! (
968976 error,
969- ValidationError ( vec! [ RuleError :: new(
977+ RuleError :: new(
970978 r#"Variable "$var" of required type "Int!" was not provided."# ,
971979 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
972- ) ] ) ,
980+ )
981+ . into( ) ,
973982 ) ;
974983}
975984
@@ -990,10 +999,11 @@ async fn does_not_allow_null_variable_for_required_field() {
990999
9911000 assert_eq ! (
9921001 error,
993- ValidationError ( vec! [ RuleError :: new(
1002+ RuleError :: new(
9941003 r#"Variable "$var" of required type "Int!" was not provided."# ,
9951004 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
996- ) ] ) ,
1005+ )
1006+ . into( ) ,
9971007 ) ;
9981008}
9991009
@@ -1091,11 +1101,12 @@ mod integers {
10911101
10921102 assert_eq ! (
10931103 error,
1094- ValidationError ( vec! [ RuleError :: new(
1104+ RuleError :: new(
10951105 "Variable \" $var\" got invalid value. Expected input scalar `Int`. \
10961106 Got: `10`. Details: Expected `Int`, found: 10.",
10971107 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
1098- ) ] ) ,
1108+ )
1109+ . into( ) ,
10991110 ) ;
11001111 }
11011112
@@ -1116,12 +1127,13 @@ mod integers {
11161127
11171128 assert_eq ! (
11181129 error,
1119- ValidationError ( vec! [ RuleError :: new(
1130+ RuleError :: new(
11201131 "Variable \" $var\" got invalid value. \
11211132 Expected input scalar `Int`. Got: `\" 10\" `. \
11221133 Details: Expected `Int`, found: \" 10\" .",
11231134 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
1124- ) ] ) ,
1135+ )
1136+ . into( ) ,
11251137 ) ;
11261138 }
11271139}
@@ -1176,12 +1188,13 @@ mod floats {
11761188
11771189 assert_eq ! (
11781190 error,
1179- ValidationError ( vec! [ RuleError :: new(
1191+ RuleError :: new(
11801192 "Variable \" $var\" got invalid value. \
11811193 Expected input scalar `Float`. Got: `\" 10\" `. \
11821194 Details: Expected `Float`, found: \" 10\" .",
11831195 & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
1184- ) ] ) ,
1196+ )
1197+ . into( ) ,
11851198 ) ;
11861199 }
11871200}
0 commit comments