add failing test for list of non-null items for issue #84

This commit is contained in:
Jacob Haslehurst 2017-11-20 11:44:11 +11:00
parent bee88d4265
commit 8cf2707faa

View file

@ -451,6 +451,7 @@ mod propagates_errors_to_nullable_fields {
graphql_object!(Schema: () |&self| {
field inner() -> Inner { Inner }
field inners() -> Vec<Inner> { (0..5).map(|_| Inner).collect() }
});
graphql_object!(Inner: () |&self| {
@ -589,6 +590,32 @@ mod propagates_errors_to_nullable_fields {
),
]);
}
#[test]
fn non_null_list() {
let schema = RootNode::new(Schema, EmptyMutation::<()>::new());
let doc = r"{ inners { nonNullableErrorField } }";
let vars = vec![].into_iter().collect();
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
println!("Result: {:?}", result);
assert_eq!(
result,
graphql_value!(None));
assert_eq!(
errs,
vec![
ExecutionError::new(
SourcePosition::new(10, 0, 10),
&["inner", "nonNullableErrorField"],
FieldError::new("Error for nonNullableErrorField", Value::null()),
),
]);
}
}
mod named_operations {