Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/eleven-birds-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'hive-console-sdk-rs': minor
'hive-apollo-router-plugin': patch
---

Breaking;

- `UsageAgent` now accepts `Duration` for `connect_timeout` and `request_timeout` instead of `u64`.
- `SupergraphFetcher` now accepts `Duration` for `connect_timeout` and `request_timeout` instead of `u64`.
- `PersistedDocumentsManager` now accepts `Duration` for `connect_timeout` and `request_timeout` instead of `u64`.
- Use original `graphql-parser` and `graphql-tools` crates instead of forked versions.
16 changes: 3 additions & 13 deletions configs/cargo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions packages/libraries/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ tokio = { version = "1.36.0", features = ["full"] }
tower = { version = "0.5", features = ["full"] }
http = "1"
http-body-util = "0.1"
graphql-parser = { version = "0.5.0", package = "graphql-parser-hive-fork" }
graphql-tools = { version = "0.4.0", features = [
"graphql_parser_fork",
], default-features = false }
graphql-tools = "0.4.0"
graphql-parser = "0.4.1"
lru = "0.16.0"
md5 = "0.7.0"
rand = "0.9.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/libraries/router/src/persisted_documents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use serde::{Deserialize, Serialize};
use std::env;
use std::ops::ControlFlow;
use std::sync::Arc;
use std::time::Duration;
use tower::{BoxError, ServiceBuilder, ServiceExt};
use tracing::{debug, info, warn};

Expand Down Expand Up @@ -102,8 +103,8 @@ impl PersistedDocumentsPlugin {
key,
endpoint,
config.accept_invalid_certs.unwrap_or(false),
config.connect_timeout.unwrap_or(5),
config.request_timeout.unwrap_or(15),
Duration::from_secs(config.connect_timeout.unwrap_or(5)),
Duration::from_secs(config.request_timeout.unwrap_or(15)),
config.retry_count.unwrap_or(3),
config.cache_size.unwrap_or(1000),
))),
Expand Down
5 changes: 3 additions & 2 deletions packages/libraries/router/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use sha2::Sha256;
use std::env;
use std::io::Write;
use std::thread;
use std::time::Duration;

#[derive(Debug)]
pub struct HiveRegistry {
Expand Down Expand Up @@ -126,8 +127,8 @@ impl HiveRegistry {
endpoint,
key,
format!("hive-apollo-router/{}", PLUGIN_VERSION),
5,
60,
Duration::from_secs(5),
Duration::from_secs(60),
accept_invalid_certs,
)
.map_err(|e| anyhow!("Failed to create SupergraphFetcher: {}", e))?,
Expand Down
4 changes: 2 additions & 2 deletions packages/libraries/router/src/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ impl Plugin for UsagePlugin {
endpoint,
target_id,
buffer_size,
connect_timeout,
request_timeout,
Duration::from_secs(connect_timeout),
Duration::from_secs(request_timeout),
accept_invalid_certs,
flush_interval,
format!("hive-apollo-router/{}", PLUGIN_VERSION),
Expand Down
6 changes: 2 additions & 4 deletions packages/libraries/sdk-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ anyhow = "1"
tracing = "0.1"
serde = "1"
tokio = { version = "1.36.0", features = ["full"] }
graphql-parser = { version = "0.5.0", package = "graphql-parser-hive-fork" }
graphql-tools = { version = "0.4.0", features = [
"graphql_parser_fork",
], default-features = false }
graphql-tools = "0.4.0"
graphql-parser = "0.4.1"
md5 = "0.7.0"
serde_json = "1"
moka = { version = "0.12.10", features = ["future", "sync"] }
Expand Down
8 changes: 4 additions & 4 deletions packages/libraries/sdk-rs/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ impl UsageAgent {
endpoint: String,
target_id: Option<String>,
buffer_size: usize,
connect_timeout: u64,
request_timeout: u64,
connect_timeout: Duration,
request_timeout: Duration,
accept_invalid_certs: bool,
flush_interval: Duration,
user_agent: String,
Expand All @@ -153,8 +153,8 @@ impl UsageAgent {

let reqwest_agent = reqwest::Client::builder()
.danger_accept_invalid_certs(accept_invalid_certs)
.connect_timeout(Duration::from_secs(connect_timeout))
.timeout(Duration::from_secs(request_timeout))
.connect_timeout(connect_timeout)
.timeout(request_timeout)
.build()
.map_err(|err| err.to_string())
.expect("Couldn't instantiate the http client for reports sending!");
Expand Down
8 changes: 4 additions & 4 deletions packages/libraries/sdk-rs/src/persisted_documents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ impl PersistedDocumentsManager {
key: String,
endpoint: String,
accept_invalid_certs: bool,
connect_timeout: u64,
request_timeout: u64,
connect_timeout: Duration,
request_timeout: Duration,
retry_count: u32,
cache_size: u64,
) -> Self {
let retry_policy = ExponentialBackoff::builder().build_with_max_retries(retry_count);

let reqwest_agent = reqwest::Client::builder()
.danger_accept_invalid_certs(accept_invalid_certs)
.connect_timeout(Duration::from_secs(connect_timeout))
.timeout(Duration::from_secs(request_timeout))
.connect_timeout(connect_timeout)
.timeout(request_timeout)
.build()
.expect("Failed to create reqwest client");
let agent = ClientBuilder::new(reqwest_agent)
Expand Down
8 changes: 4 additions & 4 deletions packages/libraries/sdk-rs/src/supergraph_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ impl SupergraphFetcher {
endpoint: String,
key: String,
user_agent: String,
connect_timeout: u64,
request_timeout: u64,
connect_timeout: Duration,
request_timeout: Duration,
accept_invalid_certs: bool,
) -> Result<Self, String> {
let mut endpoint = endpoint;
Expand All @@ -29,8 +29,8 @@ impl SupergraphFetcher {

let client = reqwest::blocking::Client::builder()
.danger_accept_invalid_certs(accept_invalid_certs)
.connect_timeout(Duration::from_secs(connect_timeout))
.timeout(Duration::from_secs(request_timeout))
.connect_timeout(connect_timeout)
.timeout(request_timeout)
.build()
.map_err(|e| e.to_string())?;

Expand Down
Loading