Commit 895d8d6e authored by Alp Deniz Ogut's avatar Alp Deniz Ogut
Browse files

gql_utils: fix fmt and return err msg

parent 0414906a
Showing with 5 additions and 4 deletions
+5 -4
......@@ -5,7 +5,8 @@ use graphql_parser::query::Field;
use graphql_parser::query::OperationDefinition;
use graphql_parser::query::Selection;
use graphql_parser::query::SelectionSet;
use graphql_parser::query::{Text, Value};
use graphql_parser::query::Text;
use graphql_parser::query::Value;
use std::convert::TryFrom;
use warp::http::status::StatusCode;
......@@ -55,11 +56,11 @@ pub fn parse_graphql_query(query_string: &str) -> Result<QueryASTNode> {
// TODO error handling
let parsed = match parse_query::<String>(query_string) {
Ok(res) => res,
Err(_) => {
Err(err) => {
return Err(Error {
code: StatusCode::BAD_REQUEST,
msg: "Invalid GraphQL query".to_owned(),
})
msg: format!("Invalid GraphQL query {}", err).to_owned(),
});
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment