-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aditya Mukhopadhyay
committed
Jul 7, 2023
1 parent
bcd47b7
commit d020fb5
Showing
5 changed files
with
23 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
use graphql_parser::{query, schema}; | ||
|
||
pub fn parse_schema(schema: &str) -> Result<schema::Document<String>, schema::ParseError> { | ||
schema::parse_schema::<String>(schema) | ||
} | ||
|
||
pub fn parse_query(query: &str) -> Result<query::Document<String>, query::ParseError> { | ||
query::parse_query::<String>(query) | ||
} | ||
pub use graphql_parser::{parse_query, parse_schema}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub const ERROR_INVALID_SCHEMA_FILE: i32 = 1; | ||
pub const ERROR_INVALID_SCHEMA: i32 = 2; | ||
pub const ERROR_BAD_QUERY: i32 = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use std::fmt::Display; | ||
|
||
pub fn error_log<E>(error_code: i32, message: &str, err: E) | ||
where | ||
E: Display, | ||
{ | ||
eprintln!("ERROR {}: {}: {}", error_code, message, err); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod error_codes; | ||
pub mod logger; |