@@ -58,6 +58,11 @@ impl Root {
58
58
arg
59
59
}
60
60
61
+ #[ graphql( arguments( r#arg( description = "The arg" ) ) ) ]
62
+ fn single_arg_descr_raw_idents ( arg : i32 ) -> i32 {
63
+ arg
64
+ }
65
+
61
66
#[ graphql( arguments(
62
67
arg1( description = "The first arg" , ) ,
63
68
arg2( description = "The second arg" )
@@ -66,9 +71,17 @@ impl Root {
66
71
arg1 + arg2
67
72
}
68
73
74
+ #[ graphql( arguments(
75
+ r#arg1( description = "The first arg" , ) ,
76
+ r#arg2( description = "The second arg" )
77
+ ) ) ]
78
+ fn multi_args_descr_raw_idents ( arg1 : i32 , arg2 : i32 ) -> i32 {
79
+ arg1 + arg2
80
+ }
81
+
69
82
#[ graphql( arguments(
70
83
arg1( description = "The first arg" , ) ,
71
- arg2( description = "The second arg" )
84
+ arg2( description = "The second arg" , )
72
85
) ) ]
73
86
fn multi_args_descr_trailing_comma ( arg1 : i32 , arg2 : i32 ) -> i32 {
74
87
arg1 + arg2
@@ -106,6 +119,11 @@ impl Root {
106
119
arg
107
120
}
108
121
122
+ #[ graphql( arguments( r#arg( default = 123 , description = "The arg" ) ) ) ]
123
+ fn arg_with_default_descr_raw_ident ( arg : i32 ) -> i32 {
124
+ arg
125
+ }
126
+
109
127
#[ graphql( arguments(
110
128
arg1( default = 123 , description = "The first arg" ) ,
111
129
arg2( default = 456 , description = "The second arg" )
@@ -114,6 +132,14 @@ impl Root {
114
132
arg1 + arg2
115
133
}
116
134
135
+ #[ graphql( arguments(
136
+ r#arg1( default = 123 , description = "The first arg" ) ,
137
+ r#arg2( default = 456 , description = "The second arg" )
138
+ ) ) ]
139
+ fn multi_args_with_default_descr_raw_ident ( arg1 : i32 , arg2 : i32 ) -> i32 {
140
+ arg1 + arg2
141
+ }
142
+
117
143
#[ graphql( arguments(
118
144
arg1( default = 123 , description = "The first arg" , ) ,
119
145
arg2( default = 456 , description = "The second arg" , )
@@ -122,6 +148,14 @@ impl Root {
122
148
arg1 + arg2
123
149
}
124
150
151
+ #[ graphql( arguments(
152
+ r#arg1( default = 123 , description = "The first arg" , ) ,
153
+ r#arg2( default = 456 , description = "The second arg" , )
154
+ ) ) ]
155
+ fn multi_args_with_default_trailing_comma_descr_raw_ident ( arg1 : i32 , arg2 : i32 ) -> i32 {
156
+ arg1 + arg2
157
+ }
158
+
125
159
#[ graphql(
126
160
arguments(
127
161
arg1(
@@ -460,6 +494,40 @@ async fn introspect_field_single_arg_descr() {
460
494
. await ;
461
495
}
462
496
497
+ #[ tokio:: test]
498
+ async fn introspect_field_single_arg_descr_raw_idents ( ) {
499
+ run_args_info_query ( "singleArgDescrRawIdents" , |args| {
500
+ assert_eq ! ( args. len( ) , 1 ) ;
501
+
502
+ assert ! ( args. contains( & Value :: object(
503
+ vec![
504
+ ( "name" , Value :: scalar( "arg" ) ) ,
505
+ ( "description" , Value :: scalar( "The arg" ) ) ,
506
+ ( "defaultValue" , Value :: null( ) ) ,
507
+ (
508
+ "type" ,
509
+ Value :: object(
510
+ vec![
511
+ ( "name" , Value :: null( ) ) ,
512
+ (
513
+ "ofType" ,
514
+ Value :: object(
515
+ vec![ ( "name" , Value :: scalar( "Int" ) ) ] . into_iter( ) . collect( ) ,
516
+ ) ,
517
+ ) ,
518
+ ]
519
+ . into_iter( )
520
+ . collect( ) ,
521
+ ) ,
522
+ ) ,
523
+ ]
524
+ . into_iter( )
525
+ . collect( ) ,
526
+ ) ) ) ;
527
+ } )
528
+ . await ;
529
+ }
530
+
463
531
#[ tokio:: test]
464
532
async fn introspect_field_multi_args_descr ( ) {
465
533
run_args_info_query ( "multiArgsDescr" , |args| {
@@ -520,6 +588,66 @@ async fn introspect_field_multi_args_descr() {
520
588
. await ;
521
589
}
522
590
591
+ #[ tokio:: test]
592
+ async fn introspect_field_multi_args_descr_raw_idents ( ) {
593
+ run_args_info_query ( "multiArgsDescrRawIdents" , |args| {
594
+ assert_eq ! ( args. len( ) , 2 ) ;
595
+
596
+ assert ! ( args. contains( & Value :: object(
597
+ vec![
598
+ ( "name" , Value :: scalar( "arg1" ) ) ,
599
+ ( "description" , Value :: scalar( "The first arg" ) ) ,
600
+ ( "defaultValue" , Value :: null( ) ) ,
601
+ (
602
+ "type" ,
603
+ Value :: object(
604
+ vec![
605
+ ( "name" , Value :: null( ) ) ,
606
+ (
607
+ "ofType" ,
608
+ Value :: object(
609
+ vec![ ( "name" , Value :: scalar( "Int" ) ) ] . into_iter( ) . collect( ) ,
610
+ ) ,
611
+ ) ,
612
+ ]
613
+ . into_iter( )
614
+ . collect( ) ,
615
+ ) ,
616
+ ) ,
617
+ ]
618
+ . into_iter( )
619
+ . collect( ) ,
620
+ ) ) ) ;
621
+
622
+ assert ! ( args. contains( & Value :: object(
623
+ vec![
624
+ ( "name" , Value :: scalar( "arg2" ) ) ,
625
+ ( "description" , Value :: scalar( "The second arg" ) ) ,
626
+ ( "defaultValue" , Value :: null( ) ) ,
627
+ (
628
+ "type" ,
629
+ Value :: object(
630
+ vec![
631
+ ( "name" , Value :: null( ) ) ,
632
+ (
633
+ "ofType" ,
634
+ Value :: object(
635
+ vec![ ( "name" , Value :: scalar( "Int" ) ) ] . into_iter( ) . collect( ) ,
636
+ ) ,
637
+ ) ,
638
+ ]
639
+ . into_iter( )
640
+ . collect( ) ,
641
+ ) ,
642
+ ) ,
643
+ ]
644
+ . into_iter( )
645
+ . collect( ) ,
646
+ ) ) ) ;
647
+ } )
648
+ . await ;
649
+ }
650
+
523
651
#[ tokio:: test]
524
652
async fn introspect_field_multi_args_descr_trailing_comma ( ) {
525
653
run_args_info_query ( "multiArgsDescrTrailingComma" , |args| {
@@ -786,6 +914,32 @@ async fn introspect_field_arg_with_default_descr() {
786
914
. await ;
787
915
}
788
916
917
+ #[ tokio:: test]
918
+ async fn introspect_field_arg_with_default_descr_raw_ident ( ) {
919
+ run_args_info_query ( "argWithDefaultDescrRawIdent" , |args| {
920
+ assert_eq ! ( args. len( ) , 1 ) ;
921
+
922
+ assert ! ( args. contains( & Value :: object(
923
+ vec![
924
+ ( "name" , Value :: scalar( "arg" ) ) ,
925
+ ( "description" , Value :: scalar( "The arg" ) ) ,
926
+ ( "defaultValue" , Value :: scalar( "123" ) ) ,
927
+ (
928
+ "type" ,
929
+ Value :: object(
930
+ vec![ ( "name" , Value :: scalar( "Int" ) ) , ( "ofType" , Value :: null( ) ) ]
931
+ . into_iter( )
932
+ . collect( ) ,
933
+ ) ,
934
+ ) ,
935
+ ]
936
+ . into_iter( )
937
+ . collect( ) ,
938
+ ) ) ) ;
939
+ } )
940
+ . await ;
941
+ }
942
+
789
943
#[ tokio:: test]
790
944
async fn introspect_field_multi_args_with_default_descr ( ) {
791
945
run_args_info_query ( "multiArgsWithDefaultDescr" , |args| {
@@ -830,6 +984,50 @@ async fn introspect_field_multi_args_with_default_descr() {
830
984
. await ;
831
985
}
832
986
987
+ #[ tokio:: test]
988
+ async fn introspect_field_multi_args_with_default_descr_raw_ident ( ) {
989
+ run_args_info_query ( "multiArgsWithDefaultDescrRawIdent" , |args| {
990
+ assert_eq ! ( args. len( ) , 2 ) ;
991
+
992
+ assert ! ( args. contains( & Value :: object(
993
+ vec![
994
+ ( "name" , Value :: scalar( "arg1" ) ) ,
995
+ ( "description" , Value :: scalar( "The first arg" ) ) ,
996
+ ( "defaultValue" , Value :: scalar( "123" ) ) ,
997
+ (
998
+ "type" ,
999
+ Value :: object(
1000
+ vec![ ( "name" , Value :: scalar( "Int" ) ) , ( "ofType" , Value :: null( ) ) ]
1001
+ . into_iter( )
1002
+ . collect( ) ,
1003
+ ) ,
1004
+ ) ,
1005
+ ]
1006
+ . into_iter( )
1007
+ . collect( ) ,
1008
+ ) ) ) ;
1009
+
1010
+ assert ! ( args. contains( & Value :: object(
1011
+ vec![
1012
+ ( "name" , Value :: scalar( "arg2" ) ) ,
1013
+ ( "description" , Value :: scalar( "The second arg" ) ) ,
1014
+ ( "defaultValue" , Value :: scalar( "456" ) ) ,
1015
+ (
1016
+ "type" ,
1017
+ Value :: object(
1018
+ vec![ ( "name" , Value :: scalar( "Int" ) ) , ( "ofType" , Value :: null( ) ) ]
1019
+ . into_iter( )
1020
+ . collect( ) ,
1021
+ ) ,
1022
+ ) ,
1023
+ ]
1024
+ . into_iter( )
1025
+ . collect( ) ,
1026
+ ) ) ) ;
1027
+ } )
1028
+ . await ;
1029
+ }
1030
+
833
1031
#[ tokio:: test]
834
1032
async fn introspect_field_multi_args_with_default_trailing_comma_descr ( ) {
835
1033
run_args_info_query ( "multiArgsWithDefaultTrailingCommaDescr" , |args| {
@@ -874,6 +1072,50 @@ async fn introspect_field_multi_args_with_default_trailing_comma_descr() {
874
1072
. await ;
875
1073
}
876
1074
1075
+ #[ tokio:: test]
1076
+ async fn introspect_field_multi_args_with_default_trailing_comma_descr_raw_ident ( ) {
1077
+ run_args_info_query ( "multiArgsWithDefaultTrailingCommaDescrRawIdent" , |args| {
1078
+ assert_eq ! ( args. len( ) , 2 ) ;
1079
+
1080
+ assert ! ( args. contains( & Value :: object(
1081
+ vec![
1082
+ ( "name" , Value :: scalar( "arg1" ) ) ,
1083
+ ( "description" , Value :: scalar( "The first arg" ) ) ,
1084
+ ( "defaultValue" , Value :: scalar( "123" ) ) ,
1085
+ (
1086
+ "type" ,
1087
+ Value :: object(
1088
+ vec![ ( "name" , Value :: scalar( "Int" ) ) , ( "ofType" , Value :: null( ) ) ]
1089
+ . into_iter( )
1090
+ . collect( ) ,
1091
+ ) ,
1092
+ ) ,
1093
+ ]
1094
+ . into_iter( )
1095
+ . collect( ) ,
1096
+ ) ) ) ;
1097
+
1098
+ assert ! ( args. contains( & Value :: object(
1099
+ vec![
1100
+ ( "name" , Value :: scalar( "arg2" ) ) ,
1101
+ ( "description" , Value :: scalar( "The second arg" ) ) ,
1102
+ ( "defaultValue" , Value :: scalar( "456" ) ) ,
1103
+ (
1104
+ "type" ,
1105
+ Value :: object(
1106
+ vec![ ( "name" , Value :: scalar( "Int" ) ) , ( "ofType" , Value :: null( ) ) ]
1107
+ . into_iter( )
1108
+ . collect( ) ,
1109
+ ) ,
1110
+ ) ,
1111
+ ]
1112
+ . into_iter( )
1113
+ . collect( ) ,
1114
+ ) ) ) ;
1115
+ } )
1116
+ . await ;
1117
+ }
1118
+
877
1119
#[ tokio:: test]
878
1120
async fn introspect_field_args_with_complex_default ( ) {
879
1121
run_args_info_query ( "argsWithComplexDefault" , |args| {
0 commit comments