Skip to content

Commit 20055e4

Browse files
committed
fix(runtime): upgrade async graphql
1 parent 5bac678 commit 20055e4

File tree

4 files changed

+49
-56
lines changed

4 files changed

+49
-56
lines changed

Cargo.lock

+44-51
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ edition = "2021"
66
rust-version = "1.64"
77

88
[dependencies]
9-
async-graphql = "2.0"
9+
async-graphql = "4.0"
1010
warp = "0.3.0"
11-
async-graphql-warp = "2.1.0"
11+
async-graphql-warp = "4.0"
1212
tokio = { version = "1.21", features = ["rt", "rt-multi-thread", "macros", "fs"] }
1313
http = "0.2"
1414
thiserror = "1.0"

src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub enum QueryError {
1212

1313
impl ErrorExtensions for QueryError {
1414
// lets define our base extensions
15-
fn extend(self) -> FieldError {
15+
fn extend(&self) -> FieldError {
1616
self.extend_with(|err, e| match err {
1717
QueryError::NotFoundError(resource) => e.set("code", format!("{} not found", resource)),
1818
QueryError::ServerError(reason) => e.set("reason", reason.to_string()),

src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extern crate thiserror;
22

33
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
44
use async_graphql::{EmptyMutation, EmptySubscription, Schema};
5-
use async_graphql_warp::Response;
5+
use async_graphql_warp::GraphQLResponse;
66
use dotenv::dotenv;
77
use log::debug;
88
use std::net::SocketAddr;
@@ -48,7 +48,7 @@ async fn main() {
4848
Schema<Query, EmptyMutation, EmptySubscription>,
4949
async_graphql::Request,
5050
)| async move {
51-
Ok::<_, Infallible>(Response::from(schema.execute(request).await))
51+
Ok::<_, Infallible>(GraphQLResponse::from(schema.execute(request).await))
5252
},
5353
);
5454

0 commit comments

Comments
 (0)