diff --git a/src/database/mod.rs b/src/database/mod.rs index 4eb76e2..7e735d6 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -18,6 +18,10 @@ impl Table { async fn name(&self) -> String { self.name.to_string() } + + async fn describe(&self) -> Vec { + Vec::new() + } } struct Query; @@ -135,6 +139,16 @@ mod queries { let expected = r#"{"data":{"tables":[{"name":"barney"},{"name":"fred"}]}}"#; support::compare(&db, &output, &expected); } + + #[async_std::test] + async fn empty_table_description() { + let db = Database::new(); + let output = db + .execute(r#"mutation {createTable(name: "pebbles"){name describe}}"#) + .await; + let expected = r#"{"data":{"createTable":{"name":"pebbles","describe":[]}}}"#; + support::compare(&db, &output, &expected); + } } #[cfg(test)]