with input objects

This commit is contained in:
2023-01-29 22:17:36 +01:00
parent 2a1f7c3f26
commit dc53fc1d47
5 changed files with 344 additions and 7 deletions

View File

@@ -15,7 +15,33 @@ mod tests {
fn can_generate_from_schema() {
let schema: IntrospectionResponse = serde_json::from_str(INTROSPECTION_QUERY).unwrap();
let code = CodeGeneration::new().generate(&schema).unwrap();
assert_eq!("some-code", code);
let expected = "use dagger_core::Scalar;
// code generated by dagger. DO NOT EDIT.
/// A global cache volume identifier.
pub struct CacheID(Scalar);
/// A content-addressed directory identifier.
pub struct DirectoryID(Scalar);
/// A file identifier.
pub struct FileID(Scalar);
/// A unique identifier for a secret.
pub struct SecretID(Scalar);
/// The platform config OS and architecture in a Container.
/// The format is [os]/[platform]/[version] (e.g. darwin/arm64/v7, windows/amd64, linux/arm64).
pub struct Platform(Scalar);
/// A unique container identifier. Null designates an empty container (scratch).
pub struct ContainerID(Scalar);
/// A content-addressed socket identifier.
pub struct SocketID(Scalar);
";
assert_eq!(expected, code);
}
const INTROSPECTION_QUERY: &str = r#"{