Skip to content

Commit

Permalink
Merge pull request #34 from Punie/update-rocket-example
Browse files Browse the repository at this point in the history
Update rocket example
  • Loading branch information
sunli829 committed Mar 31, 2021
2 parents 5ed6f98 + 8b9eefb commit 4a5cfe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rocket/starwars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2018"
[dependencies]
async-graphql = { path = "../../..", version = "2.0.3" }
async-graphql-rocket = { path = "../../../integrations/rocket", version = "2.0.3" }
rocket = { git = "https://github.com/SergioBenitez/Rocket/", rev = "48fd83a", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released
rocket = { git = "https://github.com/SergioBenitez/Rocket/", rev = "2893ce7", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released
starwars = { path = "../../models/starwars" }
4 changes: 2 additions & 2 deletions rocket/starwars/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use async_graphql::{
http::{playground_source, GraphQLPlaygroundConfig},
EmptyMutation, EmptySubscription, Schema,
};
use async_graphql_rocket::{Request, Response};
use async_graphql_rocket::{Query, Request, Response};
use rocket::{response::content, routes, State};
use starwars::{QueryRoot, StarWars};

Expand All @@ -14,7 +14,7 @@ fn graphql_playground() -> content::Html<String> {
}

#[rocket::get("/graphql?<query..>")]
async fn graphql_query(schema: State<'_, StarWarsSchema>, query: Request) -> Response {
async fn graphql_query(schema: State<'_, StarWarsSchema>, query: Query) -> Response {
query.execute(&schema).await
}

Expand Down

0 comments on commit 4a5cfe2

Please sign in to comment.