Skip to content

Commit 27c9c36

Browse files
tusharmathmogery
authored andcommitted
chore: rename methods
1 parent f2137bb commit 27c9c36

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/http/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod request_context;
77
mod request_handler;
88
mod request_template;
99
mod response;
10-
mod showcase;
10+
pub mod showcase;
1111

1212
pub use cache::*;
1313
pub use data_loader::*;
@@ -17,6 +17,5 @@ pub use request_context::RequestContext;
1717
pub use request_handler::{graphiql, handle_request};
1818
pub use request_template::RequestTemplate;
1919
pub use response::*;
20-
pub use showcase::*;
2120

2221
pub use crate::app_context::AppContext;

src/http/request_handler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use serde::de::DeserializeOwned;
1010

1111
use super::request_context::RequestContext;
1212
use super::showcase::ShowcaseResources;
13-
use super::{showcase_get_app_ctx, AppContext};
13+
use super::{showcase, AppContext};
1414
use crate::async_graphql_hyper::{GraphQLRequestLike, GraphQLResponse};
1515

1616
pub fn graphiql(req: &Request<Body>) -> Result<Response<Body>> {
@@ -119,7 +119,7 @@ pub async fn handle_request<T: DeserializeOwned + GraphQLRequestLike>(
119119
}
120120
hyper::Method::POST
121121
if app_ctx.blueprint.server.enable_showcase
122-
&& req.uri().path().ends_with("/showcase/graphql") =>
122+
&& req.uri().path() == "/showcase/graphql" =>
123123
{
124124
let resources = ShowcaseResources {
125125
http: app_ctx.universal_http_client.clone(),
@@ -130,7 +130,7 @@ pub async fn handle_request<T: DeserializeOwned + GraphQLRequestLike>(
130130
cache: app_ctx.cache.clone(),
131131
};
132132

133-
let app_ctx = match showcase_get_app_ctx::<T>(&req, resources).await? {
133+
let app_ctx = match showcase::create_app_ctx::<T>(&req, resources).await? {
134134
Ok(app_ctx) => app_ctx,
135135
Err(res) => return Ok(res),
136136
};

src/http/showcase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct ShowcaseResources {
2727
pub cache: Arc<EntityCache>,
2828
}
2929

30-
pub async fn showcase_get_app_ctx<T: DeserializeOwned + GraphQLRequestLike>(
30+
pub async fn create_app_ctx<T: DeserializeOwned + GraphQLRequestLike>(
3131
req: &Request<Body>,
3232
resources: ShowcaseResources,
3333
) -> Result<Result<AppContext, Response<Body>>> {

0 commit comments

Comments
 (0)