Skip to content

Commit cc0672d

Browse files
sunli829Miaxos
authored andcommitted
Bump async-graphql from 2.10 to 3.0.7
1 parent 1204c6a commit cc0672d

File tree

5 files changed

+18
-29
lines changed

5 files changed

+18
-29
lines changed

Cargo.lock

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async-std-comp = ["async-std"]
2020
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2121
[dependencies]
2222
protobuf = { version = "2.25.1", features = ["bytes"] }
23-
async-graphql = {version = "2.10.*", features = ["tracing"] }
23+
async-graphql = {version = "3.0.7", features = ["tracing"] }
2424
tracing = "0.1.*"
2525
tracing-futures = { version = "0.2.5", default-features = false, features = ["tokio", "futures-03", "std"] }
2626
futures = "0.3.*" # An implementation of futures and streams featuring zero allocations, composability, and itera…

src/compression.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#[cfg(feature = "compression")]
22
use libflate::gzip;
33

4+
#[cfg(feature = "compression")]
45
const TARGET_LOG_COMPRESSION: &str = "apollo-studio-extension-compression";
56

67
#[cfg(feature = "compression")]

src/lib.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl From<HTTPMethod> for Trace_HTTP_Method {
136136
/// * `protocol` - The http protocol, example: HTTP/1, HTTP/1.1, HTTP/2.
137137
/// * `status_code` - The status code return by your GraphQL API. It's a little weird to have to put it
138138
/// before executing the graphql function, it'll be changed later but usually it's just a 200.
139-
#[derive(Debug, Clone)]
139+
#[derive(Debug, Clone, Default)]
140140
pub struct ApolloTracingDataExt {
141141
pub userid: Option<String>,
142142
pub client_name: Option<String>,
@@ -149,22 +149,6 @@ pub struct ApolloTracingDataExt {
149149
pub status_code: Option<u32>,
150150
}
151151

152-
impl Default for ApolloTracingDataExt {
153-
fn default() -> Self {
154-
ApolloTracingDataExt {
155-
userid: None,
156-
client_name: None,
157-
client_version: None,
158-
path: None,
159-
host: None,
160-
method: None,
161-
secure: None,
162-
protocol: None,
163-
status_code: None,
164-
}
165-
}
166-
}
167-
168152
impl ApolloTracing {
169153
/// We initialize the ApolloTracing Extension by starting our aggregator async function which
170154
/// will receive every traces and send them to the Apollo Studio Ingress for processing
@@ -197,6 +181,7 @@ impl ApolloTracing {
197181
});
198182

199183
let client = reqwest::Client::new();
184+
#[allow(unused_mut)]
200185
let (sender, mut receiver) = channel::<(String, Trace)>(batch_target * 3);
201186

202187
let header_tokio = Arc::clone(&header);
@@ -381,7 +366,7 @@ impl Extension for ApolloTracingExtension {
381366
.data::<ApolloTracingDataExt>()
382367
.ok()
383368
.cloned()
384-
.unwrap_or_else(ApolloTracingDataExt::default);
369+
.unwrap_or_default();
385370
let client_name = tracing_extension
386371
.client_name
387372
.unwrap_or_else(|| "no client name".to_string());

src/register.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub async fn register<
6969
executableSchemaId: "{}"
7070
graphVariant: "{}"
7171
platform: "{}"
72-
libraryVersion: "{}"
72+
libraryVersion: "async-studio-extension {}"
7373
runtimeVersion: "{}"
7474
userVersion: "{}"
7575
}}
@@ -92,7 +92,7 @@ pub async fn register<
9292
sha_from_schema,
9393
variant,
9494
platform,
95-
format!("async-studio-extension {}", VERSION),
95+
VERSION,
9696
RUNTIME_VERSION,
9797
user_version
9898
);

0 commit comments

Comments
 (0)