From 5839cb93a2a7fb1d7d543e513062ee4fc2396068 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Fri, 8 Jul 2022 09:03:35 -0400 Subject: [PATCH] Added empty table description. --- src/database/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)]