mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-04 06:43:26 +02:00
can get schema
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
use core::time;
|
||||
use std::thread::sleep;
|
||||
|
||||
use graphql_introspection_query::introspection_response::IntrospectionResponse;
|
||||
|
||||
use crate::{config::Config, engine::Engine, session::Session};
|
||||
|
||||
pub fn get_schema() -> eyre::Result<IntrospectionResponse> {
|
||||
//TODO: Implement cotext for proc
|
||||
let cfg = Config::new(None, None, None, None);
|
||||
let (conn, proc) = Engine::new().start(&cfg)?;
|
||||
let session = Session::new();
|
||||
let req_builder = session.start(cfg, &conn)?;
|
||||
let schema = session.schema(req_builder)?;
|
||||
|
||||
Ok(schema)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::get_schema;
|
||||
|
||||
#[test]
|
||||
fn can_get_schema() {
|
||||
let _ = get_schema().unwrap();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user