@@ -158,7 +158,10 @@ fn inline_complex_input() {
158
158
|result : & Object < DefaultScalarValue > | {
159
159
assert_eq ! (
160
160
result. get_field_value( "fieldWithObjectInput" ) ,
161
- Some ( & Value :: scalar( r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"# ) ) ) ;
161
+ Some ( & Value :: scalar(
162
+ r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"#
163
+ ) )
164
+ ) ;
162
165
} ,
163
166
) ;
164
167
}
@@ -170,7 +173,10 @@ fn inline_parse_single_value_to_list() {
170
173
|result : & Object < DefaultScalarValue > | {
171
174
assert_eq ! (
172
175
result. get_field_value( "fieldWithObjectInput" ) ,
173
- Some ( & Value :: scalar( r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"# ) ) ) ;
176
+ Some ( & Value :: scalar(
177
+ r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"#
178
+ ) )
179
+ ) ;
174
180
} ,
175
181
) ;
176
182
}
@@ -182,7 +188,10 @@ fn inline_runs_from_input_value_on_scalar() {
182
188
|result : & Object < DefaultScalarValue > | {
183
189
assert_eq ! (
184
190
result. get_field_value( "fieldWithObjectInput" ) ,
185
- Some ( & Value :: scalar( r#"Some(TestInputObject { a: None, b: None, c: "baz", d: Some(TestComplexScalar) })"# ) ) ) ;
191
+ Some ( & Value :: scalar(
192
+ r#"Some(TestInputObject { a: None, b: None, c: "baz", d: Some(TestComplexScalar) })"#
193
+ ) )
194
+ ) ;
186
195
} ,
187
196
) ;
188
197
}
@@ -208,7 +217,10 @@ fn variable_complex_input() {
208
217
|result : & Object < DefaultScalarValue > | {
209
218
assert_eq ! (
210
219
result. get_field_value( "fieldWithObjectInput" ) ,
211
- Some ( & Value :: scalar( r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"# ) ) ) ;
220
+ Some ( & Value :: scalar(
221
+ r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"#
222
+ ) )
223
+ ) ;
212
224
} ,
213
225
) ;
214
226
}
@@ -234,7 +246,10 @@ fn variable_parse_single_value_to_list() {
234
246
|result : & Object < DefaultScalarValue > | {
235
247
assert_eq ! (
236
248
result. get_field_value( "fieldWithObjectInput" ) ,
237
- Some ( & Value :: scalar( r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"# ) ) ) ;
249
+ Some ( & Value :: scalar(
250
+ r#"Some(TestInputObject { a: Some("foo"), b: Some([Some("bar")]), c: "baz", d: None })"#
251
+ ) )
252
+ ) ;
238
253
} ,
239
254
) ;
240
255
}
@@ -259,7 +274,10 @@ fn variable_runs_from_input_value_on_scalar() {
259
274
|result : & Object < DefaultScalarValue > | {
260
275
assert_eq ! (
261
276
result. get_field_value( "fieldWithObjectInput" ) ,
262
- Some ( & Value :: scalar( r#"Some(TestInputObject { a: None, b: None, c: "baz", d: Some(TestComplexScalar) })"# ) ) ) ;
277
+ Some ( & Value :: scalar(
278
+ r#"Some(TestInputObject { a: None, b: None, c: "baz", d: Some(TestComplexScalar) })"#
279
+ ) )
280
+ ) ;
263
281
} ,
264
282
) ;
265
283
}
@@ -306,12 +324,13 @@ fn variable_error_on_incorrect_type() {
306
324
307
325
let error = crate :: execute ( query, None , & schema, & vars, & ( ) ) . unwrap_err ( ) ;
308
326
309
- assert_eq ! ( error, ValidationError ( vec![
310
- RuleError :: new(
327
+ assert_eq ! (
328
+ error,
329
+ ValidationError ( vec![ RuleError :: new(
311
330
r#"Variable "$input" got invalid value. Expected "TestInputObject", found not an object."# ,
312
331
& [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
313
- ) ,
314
- ] ) ) ;
332
+ ) , ] )
333
+ ) ;
315
334
}
316
335
317
336
#[ test]
@@ -366,16 +385,19 @@ fn variable_multiple_errors_with_nesting() {
366
385
367
386
let error = crate :: execute ( query, None , & schema, & vars, & ( ) ) . unwrap_err ( ) ;
368
387
369
- assert_eq ! ( error, ValidationError ( vec![
370
- RuleError :: new(
371
- r#"Variable "$input" got invalid value. In field "na": In field "c": Expected "String!", found null."# ,
372
- & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
373
- ) ,
374
- RuleError :: new(
375
- r#"Variable "$input" got invalid value. In field "nb": Expected "String!", found null."# ,
376
- & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
377
- ) ,
378
- ] ) ) ;
388
+ assert_eq ! (
389
+ error,
390
+ ValidationError ( vec![
391
+ RuleError :: new(
392
+ r#"Variable "$input" got invalid value. In field "na": In field "c": Expected "String!", found null."# ,
393
+ & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
394
+ ) ,
395
+ RuleError :: new(
396
+ r#"Variable "$input" got invalid value. In field "nb": Expected "String!", found null."# ,
397
+ & [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
398
+ ) ,
399
+ ] )
400
+ ) ;
379
401
}
380
402
381
403
#[ test]
@@ -733,12 +755,13 @@ fn does_not_allow_lists_of_non_null_to_contain_null() {
733
755
734
756
let error = crate :: execute ( query, None , & schema, & vars, & ( ) ) . unwrap_err ( ) ;
735
757
736
- assert_eq ! ( error, ValidationError ( vec![
737
- RuleError :: new(
758
+ assert_eq ! (
759
+ error,
760
+ ValidationError ( vec![ RuleError :: new(
738
761
r#"Variable "$input" got invalid value. In element #1: Expected "String!", found null."# ,
739
762
& [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
740
- ) ,
741
- ] ) ) ;
763
+ ) , ] )
764
+ ) ;
742
765
}
743
766
744
767
#[ test]
@@ -759,12 +782,13 @@ fn does_not_allow_non_null_lists_of_non_null_to_contain_null() {
759
782
760
783
let error = crate :: execute ( query, None , & schema, & vars, & ( ) ) . unwrap_err ( ) ;
761
784
762
- assert_eq ! ( error, ValidationError ( vec![
763
- RuleError :: new(
785
+ assert_eq ! (
786
+ error,
787
+ ValidationError ( vec![ RuleError :: new(
764
788
r#"Variable "$input" got invalid value. In element #1: Expected "String!", found null."# ,
765
789
& [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
766
- ) ,
767
- ] ) ) ;
790
+ ) , ] )
791
+ ) ;
768
792
}
769
793
770
794
#[ test]
@@ -820,12 +844,13 @@ fn does_not_allow_invalid_types_to_be_used_as_values() {
820
844
821
845
let error = crate :: execute ( query, None , & schema, & vars, & ( ) ) . unwrap_err ( ) ;
822
846
823
- assert_eq ! ( error, ValidationError ( vec![
824
- RuleError :: new(
847
+ assert_eq ! (
848
+ error,
849
+ ValidationError ( vec![ RuleError :: new(
825
850
r#"Variable "$input" expected value of type "TestType!" which cannot be used as an input type."# ,
826
851
& [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
827
- ) ,
828
- ] ) ) ;
852
+ ) , ] )
853
+ ) ;
829
854
}
830
855
831
856
#[ test]
@@ -842,12 +867,13 @@ fn does_not_allow_unknown_types_to_be_used_as_values() {
842
867
843
868
let error = crate :: execute ( query, None , & schema, & vars, & ( ) ) . unwrap_err ( ) ;
844
869
845
- assert_eq ! ( error, ValidationError ( vec![
846
- RuleError :: new(
870
+ assert_eq ! (
871
+ error,
872
+ ValidationError ( vec![ RuleError :: new(
847
873
r#"Variable "$input" expected value of type "UnknownType!" which cannot be used as an input type."# ,
848
874
& [ SourcePosition :: new( 8 , 0 , 8 ) ] ,
849
- ) ,
850
- ] ) ) ;
875
+ ) , ] )
876
+ ) ;
851
877
}
852
878
853
879
#[ test]
0 commit comments