Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David Kosztka
Pod
Commits
895d8d6e
Commit
895d8d6e
authored
2 years ago
by
Alp Deniz Ogut
Browse files
Options
Download
Email Patches
Plain Diff
gql_utils: fix fmt and return err msg
parent
0414906a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graphql_utils.rs
+5
-4
src/graphql_utils.rs
with
5 additions
and
4 deletions
+5
-4
src/graphql_utils.rs
+
5
-
4
View file @
895d8d6e
...
...
@@ -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
(),
})
;
}
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets