Skip to content

Commit b41f8f9

Browse files
renamed variables / print statements
1 parent 1add2c2 commit b41f8f9

File tree

22 files changed

+54
-63
lines changed

22 files changed

+54
-63
lines changed

actix-web/error-extensions/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async fn gql_playgound() -> HttpResponse {
110110

111111
#[actix_web::main]
112112
async fn main() -> std::io::Result<()> {
113-
println!("Playground: http://localhost:8000");
113+
println!("GraphiQL IDE: http://localhost:8000");
114114

115115
HttpServer::new(move || {
116116
App::new()

actix-web/starwars/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async fn index(schema: web::Data<StarWarsSchema>, req: GraphQLRequest) -> GraphQ
77
schema.execute(req.into_inner()).await.into()
88
}
99

10-
async fn index_playground() -> Result<HttpResponse> {
10+
async fn index_graphiql() -> Result<HttpResponse> {
1111
Ok(HttpResponse::Ok()
1212
.content_type("text/html; charset=utf-8")
1313
.body(
@@ -23,13 +23,13 @@ async fn main() -> std::io::Result<()> {
2323
.data(StarWars::new())
2424
.finish();
2525

26-
println!("Playground: http://localhost:8000");
26+
println!("GraphiQL IDE: http://localhost:8000");
2727

2828
HttpServer::new(move || {
2929
App::new()
3030
.app_data(Data::new(schema.clone()))
3131
.service(web::resource("/").guard(guard::Post()).to(index))
32-
.service(web::resource("/").guard(guard::Get()).to(index_playground))
32+
.service(web::resource("/").guard(guard::Get()).to(index_graphiql))
3333
})
3434
.bind("127.0.0.1:8000")?
3535
.run()

actix-web/subscription/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async fn index(schema: web::Data<BooksSchema>, req: GraphQLRequest) -> GraphQLRe
77
schema.execute(req.into_inner()).await.into()
88
}
99

10-
async fn index_playground() -> Result<HttpResponse> {
10+
async fn index_graphiql() -> Result<HttpResponse> {
1111
Ok(HttpResponse::Ok()
1212
.content_type("text/html; charset=utf-8")
1313
.body(
@@ -32,7 +32,7 @@ async fn main() -> std::io::Result<()> {
3232
.data(Storage::default())
3333
.finish();
3434

35-
println!("Playground: http://localhost:8000");
35+
println!("GraphiQL IDE: http://localhost:8000");
3636

3737
HttpServer::new(move || {
3838
App::new()
@@ -44,7 +44,7 @@ async fn main() -> std::io::Result<()> {
4444
.guard(guard::Header("upgrade", "websocket"))
4545
.to(index_ws),
4646
)
47-
.service(web::resource("/").guard(guard::Get()).to(index_playground))
47+
.service(web::resource("/").guard(guard::Get()).to(index_graphiql))
4848
})
4949
.bind("127.0.0.1:8000")?
5050
.run()

actix-web/token-from-header/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use async_graphql::{http::GraphiQLSource, Data, EmptyMutation, Schema};
55
use async_graphql_actix_web::{GraphQLRequest, GraphQLResponse, GraphQLSubscription};
66
use token::{on_connection_init, QueryRoot, SubscriptionRoot, Token, TokenSchema};
77

8-
async fn gql_playground() -> HttpResponse {
8+
async fn graphiql() -> HttpResponse {
99
HttpResponse::Ok()
1010
.content_type("text/html; charset=utf-8")
1111
.body(
@@ -54,12 +54,12 @@ async fn index_ws(
5454
async fn main() -> std::io::Result<()> {
5555
let schema = Schema::new(QueryRoot, EmptyMutation, SubscriptionRoot);
5656

57-
println!("Playground: http://localhost:8000");
57+
println!("GraphiQL IDE: http://localhost:8000");
5858

5959
HttpServer::new(move || {
6060
App::new()
6161
.app_data(web::Data::new(schema.clone()))
62-
.service(web::resource("/").guard(guard::Get()).to(gql_playground))
62+
.service(web::resource("/").guard(guard::Get()).to(graphiql))
6363
.service(web::resource("/").guard(guard::Post()).to(index))
6464
.service(web::resource("/ws").to(index_ws))
6565
})

actix-web/upload/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async fn main() -> std::io::Result<()> {
2626
.data(Storage::default())
2727
.finish();
2828

29-
println!("Playground: http://localhost:8000");
29+
println!("GraphiQL IDE: http://localhost:8000");
3030

3131
HttpServer::new(move || {
3232
App::new()

axum/starwars/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async fn graphql_handler(
1515
schema.execute(req.into_inner()).await.into()
1616
}
1717

18-
async fn graphql_playground() -> impl IntoResponse {
18+
async fn graphiql() -> impl IntoResponse {
1919
response::Html(
2020
GraphiQLSource::build()
2121
.endpoint("http://localhost:8000")
@@ -30,10 +30,10 @@ async fn main() {
3030
.finish();
3131

3232
let app = Router::new()
33-
.route("/", get(graphql_playground).post(graphql_handler))
33+
.route("/", get(graphiql).post(graphql_handler))
3434
.layer(Extension(schema));
3535

36-
println!("Playground: http://localhost:8000");
36+
println!("GraphiQL IDE: http://localhost:8000");
3737

3838
Server::bind(&"0.0.0.0:8000".parse().unwrap())
3939
.serve(app.into_make_service())

axum/subscription/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async fn graphql_handler(schema: Extension<BooksSchema>, req: GraphQLRequest) ->
1212
schema.execute(req.into_inner()).await.into()
1313
}
1414

15-
async fn graphql_playground() -> impl IntoResponse {
15+
async fn graphiql() -> impl IntoResponse {
1616
response::Html(
1717
GraphiQLSource::build()
1818
.endpoint("http://localhost:8000")
@@ -28,11 +28,11 @@ async fn main() {
2828
.finish();
2929

3030
let app = Router::new()
31-
.route("/", get(graphql_playground).post(graphql_handler))
31+
.route("/", get(graphiql).post(graphql_handler))
3232
.route("/ws", GraphQLSubscription::new(schema.clone()))
3333
.layer(Extension(schema));
3434

35-
println!("Playground: http://localhost:8000");
35+
println!("GraphiQL IDE: http://localhost:8000");
3636

3737
Server::bind(&"0.0.0.0:8000".parse().unwrap())
3838
.serve(app.into_make_service())

axum/upload/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async fn graphql_handler(schema: Extension<FilesSchema>, req: GraphQLRequest) ->
1414
schema.execute(req.0).await.into()
1515
}
1616

17-
async fn graphql_playground() -> impl IntoResponse {
17+
async fn graphiql() -> impl IntoResponse {
1818
Html(
1919
GraphiQLSource::build()
2020
.endpoint("http://localhost:8000")
@@ -28,10 +28,10 @@ async fn main() {
2828
.data(Storage::default())
2929
.finish();
3030

31-
println!("Playground: http://localhost:8000");
31+
println!("GraphiQL IDE: http://localhost:8000");
3232

3333
let app = Router::new()
34-
.route("/", get(graphql_playground).post(graphql_handler))
34+
.route("/", get(graphiql).post(graphql_handler))
3535
.layer(Extension(schema))
3636
.layer(
3737
CorsLayer::new()

poem/starwars/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use poem::{get, handler, listener::TcpListener, web::Html, IntoResponse, Route,
44
use starwars::{QueryRoot, StarWars};
55

66
#[handler]
7-
async fn graphql_playground() -> impl IntoResponse {
7+
async fn graphiql() -> impl IntoResponse {
88
Html(
99
GraphiQLSource::build()
1010
.endpoint("http://localhost:8000")
@@ -18,9 +18,9 @@ async fn main() {
1818
.data(StarWars::new())
1919
.finish();
2020

21-
let app = Route::new().at("/", get(graphql_playground).post(GraphQL::new(schema)));
21+
let app = Route::new().at("/", get(graphiql).post(GraphQL::new(schema)));
2222

23-
println!("Playground: http://localhost:8000");
23+
println!("GraphiQL IDE: http://localhost:8000");
2424
Server::new(TcpListener::bind("0.0.0.0:8000"))
2525
.run(app)
2626
.await

poem/subscription-redis/src/main.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl SubscriptionRoot {
4040
}
4141

4242
#[handler]
43-
async fn graphql_playground() -> impl IntoResponse {
43+
async fn graphiql() -> impl IntoResponse {
4444
Html(
4545
GraphiQLSource::build()
4646
.endpoint("http://localhost:8000")
@@ -58,13 +58,10 @@ async fn main() {
5858
.finish();
5959

6060
let app = Route::new()
61-
.at(
62-
"/",
63-
get(graphql_playground).post(GraphQL::new(schema.clone())),
64-
)
61+
.at("/", get(graphiql).post(GraphQL::new(schema.clone())))
6562
.at("/ws", get(GraphQLSubscription::new(schema)));
6663

67-
println!("Playground: http://localhost:8000");
64+
println!("GraphiQL IDE: http://localhost:8000");
6865
Server::new(TcpListener::bind("0.0.0.0:8000"))
6966
.run(app)
7067
.await

0 commit comments

Comments
 (0)