Update book
This commit is contained in:
parent
35ce31ef78
commit
39ba3b4aec
|
@ -14,7 +14,7 @@ When you define your `actix_web::App` you need to pass in the Schema as data.
|
|||
async fn index(
|
||||
// Schema now accessible here
|
||||
schema: web::Data<Schema>,
|
||||
request: Request,
|
||||
request: async_graphql_actix_web::Request,
|
||||
) -> web::Json<Response> {
|
||||
web::Json(Response(schema.execute(request.into_inner()).await)
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ let filter = async_graphql_warp::graphql(schema).and_then(|(schema, request): (M
|
|||
let resp = schema.execute(request).await;
|
||||
|
||||
// Return result
|
||||
Ok::<_, Infallible>(warp::reply::json(resp).into_response())
|
||||
Ok::<_, Infallible>(async_graphql_warp::Response::from(resp))
|
||||
});
|
||||
warp::serve(filter).run(([0, 0, 0, 0], 8000)).await;
|
||||
```
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
```rust
|
||||
async fn index(
|
||||
schema: web::Data<Schema>,
|
||||
request: Request,
|
||||
request: async_graphql_actix_web::Request,
|
||||
) -> web::Json<Response> {
|
||||
web::Json(Response(schema.execute(request.into_inner()).await)
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ let filter = async_graphql_warp::graphql(schema).and_then(|(schema, request): (M
|
|||
let resp = schema.execute(request).await;
|
||||
|
||||
// 返回结果
|
||||
Ok::<_, Infallible>(warp::reply::json(resp).into_response())
|
||||
Ok::<_, Infallible>(async_graphql_warp::Response::from(resp))
|
||||
});
|
||||
warp::serve(filter).run(([0, 0, 0, 0], 8000)).await;
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue