mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-06 07:23:27 +02:00
added scalars
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use genco::{prelude::rust, quote, quote_in};
|
||||
use graphql_introspection_query::introspection_response::{
|
||||
FullType, IntrospectionResponse, Schema,
|
||||
};
|
||||
@@ -34,8 +35,10 @@ impl CodeGeneration {
|
||||
}
|
||||
|
||||
fn generate_from_schema(&self, schema: &Schema) -> eyre::Result<String> {
|
||||
let mut output = String::new();
|
||||
output.push_str("# code generated by dagger. DO NOT EDIT.");
|
||||
let mut output = rust::Tokens::new();
|
||||
output.append(quote! {
|
||||
$(format!("// code generated by dagger. DO NOT EDIT."))
|
||||
});
|
||||
|
||||
let types = get_types(schema)?;
|
||||
//let remaining: Vec<Option<String>> = types.into_iter().map(type_name).collect();
|
||||
@@ -44,12 +47,14 @@ impl CodeGeneration {
|
||||
for t in types {
|
||||
if let Some(_) = self.type_name(&t) {
|
||||
let rendered = handler.render(&t)?;
|
||||
output.push_str(&rendered)
|
||||
|
||||
output.push();
|
||||
output.append(rendered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(output)
|
||||
Ok(output.to_string()?)
|
||||
}
|
||||
|
||||
pub fn group_by_handlers(&self, types: &Vec<&FullType>) -> Vec<(DynHandler, Vec<FullType>)> {
|
||||
|
Reference in New Issue
Block a user