We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when named_nn_list or named_list resolved to Ok(None), the response should be null but an empty array is returned.
named_nn_list
named_list
Ok(None)
null
actual: Object {"hello": Array []} expected: Object {"hello": Null}
use async_graphql::dynamic::*; pub fn create_schema() -> Schema { let query = Object::new("Query"); let field = Field::new("hello", TypeRef::named_nn_list(TypeRef::STRING), |_ctx| { FieldFuture::new(async move { return Ok(None as Option<FieldValue>); }) }); let query = query.field(field); let schema = Schema::build(query.type_name(), None, None); let schema = schema.register(query); schema.finish().unwrap() } #[cfg(test)] mod tests { use super::*; use crate::schema_utils::normalize_schema; #[tokio::test] async fn test_query() { let schema = create_schema(); let query = r#"{ hello }"#; let res = schema.execute(query).await; assert_eq!( res.data.into_json().unwrap(), serde_json::json!({ "hello": null }) ); } }
type Query { hello: [String!] } schema { query: Query }
The text was updated successfully, but these errors were encountered:
4f6e472
No branches or pull requests
when
named_nn_list
ornamed_list
resolved toOk(None)
, the response should benull
but an empty array is returned.Actual/Expected Behavior
Steps to Reproduce the Problem
Specifications
The text was updated successfully, but these errors were encountered: