Skip to content

Update actix-web beta #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 23, 2021
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
2 changes: 1 addition & 1 deletion docs/book/content/advanced/dataloaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ DataLoader caching does not replace Redis, Memcache, or any other shared applica

```toml
[dependencies]
actix-identity = "0.4.0-beta.2"
actix-identity = "0.4.0-beta.4"
actix-rt = "1.0"
actix-web = {version = "2.0", features = []}
juniper = { git = "https://github.com/graphql-rust/juniper" }
Expand Down
4 changes: 2 additions & 2 deletions examples/actix_subscriptions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ authors = ["Mihai Dinculescu <[email protected]>"]
publish = false

[dependencies]
actix-web = "4.0.0-beta.8"
actix-cors = "0.6.0-beta.2"
actix-web = "4.0.0-beta.12"
actix-cors = "0.6.0-beta.4"
futures = "0.3"
env_logger = "0.9"
serde = "1.0"
Expand Down
12 changes: 6 additions & 6 deletions juniper_actix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ subscriptions = ["juniper_graphql_ws", "tokio"]

[dependencies]
actix = "0.12"
actix-http = "3.0.0-beta.8"
actix-http = "3.0.0-beta.13"
http = "0.2.4"
actix-web = "4.0.0-beta.8"
actix-web-actors = "4.0.0-beta.6"
actix-web = "4.0.0-beta.12"
actix-web-actors = "4.0.0-beta.7"

juniper = { version = "0.15.7", path = "../juniper", default-features = false }
juniper_graphql_ws = { version = "0.3.0", path = "../juniper_graphql_ws", optional = true }
Expand All @@ -30,11 +30,11 @@ tokio = { version = "1.0", features = ["sync"], optional = true }

[dev-dependencies]
actix-rt = "2"
actix-cors = "0.6.0-beta.2"
actix-identity = "0.4.0-beta.2"
actix-cors = "0.6.0-beta.4"
actix-identity = "0.4.0-beta.4"
tokio = "1.0"
async-stream = "0.3"
actix-test = "0.1.0-beta.3"
actix-test = "0.1.0-beta.6"

juniper = { version = "0.15.7", path = "../juniper", features = ["expose-test-schema"] }

Expand Down
31 changes: 19 additions & 12 deletions juniper_actix/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,14 @@ pub mod subscriptions {
#[cfg(test)]
mod tests {
use actix_http::body::AnyBody;
use actix_web::{dev::ServiceResponse, http, http::header::CONTENT_TYPE, test, web::Data, App};
use actix_web::{
dev::ServiceResponse,
http,
http::header::CONTENT_TYPE,
test::{self, TestRequest},
web::Data,
App,
};
use juniper::{
http::tests::{run_http_test_suite, HttpIntegration, TestResponse},
tests::fixtures::starwars::schema::{Database, Query},
Expand Down Expand Up @@ -509,7 +516,7 @@ mod tests {
}
let mut app =
test::init_service(App::new().route("/", web::get().to(graphql_handler))).await;
let req = test::TestRequest::get()
let req = TestRequest::get()
.uri("/")
.append_header((ACCEPT, "text/html"))
.to_request();
Expand All @@ -525,7 +532,7 @@ mod tests {
}
let mut app =
test::init_service(App::new().route("/", web::get().to(graphql_handler))).await;
let req = test::TestRequest::get()
let req = TestRequest::get()
.uri("/")
.append_header((ACCEPT, "text/html"))
.to_request();
Expand All @@ -550,7 +557,7 @@ mod tests {
}
let mut app =
test::init_service(App::new().route("/", web::get().to(graphql_handler))).await;
let req = test::TestRequest::get()
let req = TestRequest::get()
.uri("/")
.append_header((ACCEPT, "text/html"))
.to_request();
Expand All @@ -566,7 +573,7 @@ mod tests {
}
let mut app =
test::init_service(App::new().route("/", web::get().to(graphql_handler))).await;
let req = test::TestRequest::get()
let req = TestRequest::get()
.uri("/")
.append_header((ACCEPT, "text/html"))
.to_request();
Expand All @@ -589,7 +596,7 @@ mod tests {
EmptySubscription::<Database>::new(),
);

let req = test::TestRequest::post()
let req = TestRequest::post()
.append_header(("content-type", "application/json; charset=utf-8"))
.set_payload(
r##"{ "variables": null, "query": "{ hero(episode: NEW_HOPE) { name } }" }"##,
Expand Down Expand Up @@ -625,7 +632,7 @@ mod tests {
EmptySubscription::<Database>::new(),
);

let req = test::TestRequest::get()
let req = TestRequest::get()
.append_header(("content-type", "application/json"))
.uri("/?query=%7B%20hero%28episode%3A%20NEW_HOPE%29%20%7B%20name%20%7D%20%7D&variables=null")
.to_request();
Expand Down Expand Up @@ -663,7 +670,7 @@ mod tests {
EmptySubscription::<Database>::new(),
);

let req = test::TestRequest::post()
let req = TestRequest::post()
.append_header(("content-type", "application/json"))
.set_payload(
r##"[
Expand Down Expand Up @@ -705,7 +712,7 @@ mod tests {
pub struct TestActixWebIntegration;

impl TestActixWebIntegration {
fn make_request(&self, req: test::TestRequest) -> TestResponse {
fn make_request(&self, req: TestRequest) -> TestResponse {
actix_web::rt::System::new().block_on(async move {
let schema = Schema::new(
Query,
Expand All @@ -728,12 +735,12 @@ mod tests {

impl HttpIntegration for TestActixWebIntegration {
fn get(&self, url: &str) -> TestResponse {
self.make_request(test::TestRequest::get().uri(url))
self.make_request(TestRequest::get().uri(url))
}

fn post_json(&self, url: &str, body: &str) -> TestResponse {
self.make_request(
test::TestRequest::post()
TestRequest::post()
.append_header(("content-type", "application/json"))
.set_payload(body.to_string())
.uri(url),
Expand All @@ -742,7 +749,7 @@ mod tests {

fn post_graphql(&self, url: &str, body: &str) -> TestResponse {
self.make_request(
test::TestRequest::post()
TestRequest::post()
.append_header(("content-type", "application/graphql"))
.set_payload(body.to_string())
.uri(url),
Expand Down