Skip to content

Commit 8b79f5b

Browse files
authored
Update Actix to the latest version (#761)
* actix updated to latest version and actix rt removed * actix rt added back as dev dep
1 parent ef82b5a commit 8b79f5b

File tree

6 files changed

+23
-22
lines changed

6 files changed

+23
-22
lines changed

examples/actix_subscriptions/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ edition = "2018"
66
publish = false
77

88
[dependencies]
9-
actix-web = "2.0.0"
10-
actix-rt = "1.1.1"
11-
actix-cors = "0.2.0"
9+
actix-web = "3.0.0"
10+
actix-cors = "0.3.0"
1211

1312
futures = "0.3.5"
1413
tokio = { version = "0.2", features = ["rt-core", "macros"] }

examples/actix_subscriptions/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async fn subscriptions(
104104
subscriptions_handler(req, stream, schema, config).await
105105
}
106106

107-
#[actix_rt::main]
107+
#[actix_web::main]
108108
async fn main() -> std::io::Result<()> {
109109
env::set_var("RUST_LOG", "info");
110110
env_logger::init();

juniper_actix/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# master
2+
- Actix package updated to 3.0.0
23
- Subscription support
34
- Initial Release

juniper_actix/Cargo.toml

+8-7
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ edition = "2018"
1212
subscriptions = ["juniper_graphql_ws"]
1313

1414
[dependencies]
15-
actix = "0.9.0"
16-
actix-rt = "1.1.1"
17-
actix-web = { version = "2.0.0", features = ["rustls"] }
18-
actix-web-actors = "2.0.0"
15+
actix = "0.10.0"
16+
actix-web = { version = "3.0.0", features = ["rustls"] }
17+
actix-web-actors = "3.0.0"
18+
1919

2020
futures = { version = "0.3.5", features = ["compat"] }
2121
tokio = { version = "0.2", features = ["time"] }
22-
serde = { version = "1.0.115", features = ["derive"] }
22+
serde = { version = "1.0.116", features = ["derive"] }
2323
serde_json = "1.0.57"
2424
anyhow = "1.0"
2525
thiserror = "1.0"
@@ -28,8 +28,9 @@ juniper = { version = "0.14.2", path = "../juniper", default-features = false }
2828
juniper_graphql_ws = { path = "../juniper_graphql_ws", optional = true }
2929

3030
[dev-dependencies]
31-
actix-cors = "0.2.0"
32-
actix-identity = "0.2.1"
31+
actix-rt = "1.1.1"
32+
actix-cors = "0.3.0"
33+
actix-identity = "0.3.0"
3334

3435
bytes = "0.5.6"
3536
env_logger = "0.7.1"

juniper_actix/examples/actix_server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async fn graphql(
3737
graphql_handler(&schema, &context, req, payload).await
3838
}
3939

40-
#[actix_rt::main]
40+
#[actix_web::main]
4141
async fn main() -> std::io::Result<()> {
4242
env::set_var("RUST_LOG", "info");
4343
env_logger::init();

juniper_actix/src/lib.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,13 @@ mod tests {
517517
graphql_handler(&schema, &context, req, payload).await
518518
}
519519

520-
#[actix_rt::test]
520+
#[actix_web::rt::test]
521521
async fn graphiql_response_does_not_panic() {
522522
let result = graphiql_handler("/abcd", None).await;
523523
assert!(result.is_ok())
524524
}
525525

526-
#[actix_rt::test]
526+
#[actix_web::rt::test]
527527
async fn graphiql_endpoint_matches() {
528528
async fn graphql_handler() -> Result<HttpResponse, Error> {
529529
graphiql_handler("/abcd", None).await
@@ -539,7 +539,7 @@ mod tests {
539539
assert_eq!(resp.status(), http::StatusCode::OK);
540540
}
541541

542-
#[actix_rt::test]
542+
#[actix_web::rt::test]
543543
async fn graphiql_endpoint_returns_graphiql_source() {
544544
async fn graphql_handler() -> Result<HttpResponse, Error> {
545545
graphiql_handler("/dogs-api/graphql", Some("/dogs-api/subscriptions")).await
@@ -564,7 +564,7 @@ mod tests {
564564
))
565565
}
566566

567-
#[actix_rt::test]
567+
#[actix_web::rt::test]
568568
async fn playground_endpoint_matches() {
569569
async fn graphql_handler() -> Result<HttpResponse, Error> {
570570
playground_handler("/abcd", None).await
@@ -580,7 +580,7 @@ mod tests {
580580
assert_eq!(resp.status(), http::StatusCode::OK);
581581
}
582582

583-
#[actix_rt::test]
583+
#[actix_web::rt::test]
584584
async fn playground_endpoint_returns_playground_source() {
585585
async fn graphql_handler() -> Result<HttpResponse, Error> {
586586
playground_handler("/dogs-api/graphql", Some("/dogs-api/subscriptions")).await
@@ -602,7 +602,7 @@ mod tests {
602602
assert!(body.contains("GraphQLPlayground.init(root, { endpoint: '/dogs-api/graphql', subscriptionEndpoint: '/dogs-api/subscriptions' })"));
603603
}
604604

605-
#[actix_rt::test]
605+
#[actix_web::rt::test]
606606
async fn graphql_post_works_json_post() {
607607
let schema: Schema = RootNode::new(
608608
Query,
@@ -634,7 +634,7 @@ mod tests {
634634
);
635635
}
636636

637-
#[actix_rt::test]
637+
#[actix_web::rt::test]
638638
async fn graphql_get_works() {
639639
let schema: Schema = RootNode::new(
640640
Query,
@@ -663,7 +663,7 @@ mod tests {
663663
);
664664
}
665665

666-
#[actix_rt::test]
666+
#[actix_web::rt::test]
667667
async fn batch_request_works() {
668668
use juniper::{
669669
tests::fixtures::starwars::{model::Database, schema::Query},
@@ -715,7 +715,7 @@ mod tests {
715715

716716
impl TestActixWebIntegration {
717717
fn make_request(&self, req: test::TestRequest) -> TestResponse {
718-
actix_rt::System::new("request").block_on(async move {
718+
actix_web::rt::System::new("request").block_on(async move {
719719
let schema = RootNode::new(
720720
Query,
721721
EmptyMutation::<Database>::new(),
@@ -877,7 +877,7 @@ mod subscription_tests {
877877
subscriptions_handler(req, stream, schema, config).await
878878
}
879879

880-
#[actix_rt::test]
880+
#[actix_web::rt::test]
881881
async fn test_actix_ws_integration() {
882882
run_ws_test_suite(&mut TestActixWsIntegration::default()).await;
883883
}

0 commit comments

Comments
 (0)