Added GraphQL query function.

This commit is contained in:
Jeff Baskin 2022-06-27 12:15:12 -04:00
parent 4bd1a91704
commit c70e403266
1 changed files with 22 additions and 0 deletions

View File

@ -5,4 +5,26 @@ impl Database {
pub fn new() -> Self {
Self {}
}
pub async fn query(&self, _qry: &str) -> String {
"{data{}}".to_string()
}
}
#[cfg(test)]
mod queries {
use super::*;
#[async_std::test]
async fn empty_table_query() {
let expected = "{data{}}";
let testdb = Database::new();
let output = testdb.query("{tables{name}}").await;
assert!(
output == expected,
"Got '{}' expected '{}'.",
output,
expected
);
}
}