pub struct SchemaParser {}Expand description
Schema parser.
Transforms JSON schema from authoring languages into internal IR.
Implementations§
Source§impl SchemaParser
impl SchemaParser
Sourcepub fn parse(&self, schema_json: &str) -> Result<AuthoringIR>
pub fn parse(&self, schema_json: &str) -> Result<AuthoringIR>
Parse JSON schema into IR.
§Arguments
schema_json- JSON schema string from decorators
§Returns
Parsed Authoring IR
§Errors
Returns error if JSON is malformed or missing required fields.
§Example
use fraiseql_core::compiler::parser::SchemaParser;
let parser = SchemaParser::new();
let json = r#"{"types": [], "queries": [], "mutations": [], "subscriptions": []}"#;
let ir = parser.parse(json).unwrap();
assert!(ir.types.is_empty());Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchemaParser
impl RefUnwindSafe for SchemaParser
impl Send for SchemaParser
impl Sync for SchemaParser
impl Unpin for SchemaParser
impl UnsafeUnpin for SchemaParser
impl UnwindSafe for SchemaParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more