mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-29 10:12:27 +01:00
28 lines
672 B
Rust
28 lines
672 B
Rust
#![deny(warnings)]
|
|
|
|
mod functions;
|
|
mod generator;
|
|
pub mod rust;
|
|
pub mod utility;
|
|
mod visitor;
|
|
|
|
use dagger_core::introspection::Schema;
|
|
|
|
use self::generator::DynGenerator;
|
|
|
|
fn set_schema_parents(mut schema: Schema) -> Schema {
|
|
for t in schema.types.as_mut().into_iter().flatten().flatten() {
|
|
let t_parent = t.full_type.clone();
|
|
for mut field in t.full_type.fields.as_mut().into_iter().flatten() {
|
|
field.parent_type = Some(t_parent.clone());
|
|
}
|
|
}
|
|
|
|
return schema;
|
|
}
|
|
|
|
pub fn generate(schema: Schema, generator: DynGenerator) -> eyre::Result<String> {
|
|
let schema = set_schema_parents(schema);
|
|
generator.generate(schema)
|
|
}
|