feat: extract client (#48)

This extracts the client (strategy pattern), this is so that it is will be possible to test the actual querier, without hitting / requiring the dagger-engine running.
This commit is contained in:
2023-03-19 01:01:24 +01:00
committed by GitHub
parent 384294b390
commit 11d20935c6
10 changed files with 289 additions and 232 deletions

View File

@@ -1,5 +1,6 @@
use std::{collections::HashMap, ops::Add, sync::Arc};
use dagger_core::graphql_client::DynGraphQLClient;
use eyre::Context;
use serde::{Deserialize, Serialize};
@@ -116,7 +117,7 @@ impl Selection {
Ok(fields.join("{") + &"}".repeat(fields.len() - 1))
}
pub async fn execute<D>(&self, gql_client: &gql_client::Client) -> eyre::Result<D>
pub async fn execute<D>(&self, gql_client: DynGraphQLClient) -> eyre::Result<D>
where
D: for<'de> Deserialize<'de>,
{