Skip to content

Commit

Permalink
chore: rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath authored and mogery committed Feb 1, 2024
1 parent f2137bb commit 27c9c36
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod request_context;
mod request_handler;
mod request_template;
mod response;
mod showcase;
pub mod showcase;

pub use cache::*;
pub use data_loader::*;
Expand All @@ -17,6 +17,5 @@ pub use request_context::RequestContext;
pub use request_handler::{graphiql, handle_request};
pub use request_template::RequestTemplate;
pub use response::*;
pub use showcase::*;

pub use crate::app_context::AppContext;
6 changes: 3 additions & 3 deletions src/http/request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde::de::DeserializeOwned;

use super::request_context::RequestContext;
use super::showcase::ShowcaseResources;
use super::{showcase_get_app_ctx, AppContext};
use super::{showcase, AppContext};
use crate::async_graphql_hyper::{GraphQLRequestLike, GraphQLResponse};

pub fn graphiql(req: &Request<Body>) -> Result<Response<Body>> {
Expand Down Expand Up @@ -119,7 +119,7 @@ pub async fn handle_request<T: DeserializeOwned + GraphQLRequestLike>(
}
hyper::Method::POST
if app_ctx.blueprint.server.enable_showcase
&& req.uri().path().ends_with("/showcase/graphql") =>
&& req.uri().path() == "/showcase/graphql" =>
{
let resources = ShowcaseResources {
http: app_ctx.universal_http_client.clone(),

Check failure on line 125 in src/http/request_handler.rs

View workflow job for this annotation

GitHub Actions / Run Tests

no field `universal_http_client` on type `Arc<AppContext>`

Check failure on line 125 in src/http/request_handler.rs

View workflow job for this annotation

GitHub Actions / Macro Benchmarks

no field `universal_http_client` on type `Arc<AppContext>`
Expand All @@ -130,7 +130,7 @@ pub async fn handle_request<T: DeserializeOwned + GraphQLRequestLike>(
cache: app_ctx.cache.clone(),

Check failure on line 130 in src/http/request_handler.rs

View workflow job for this annotation

GitHub Actions / Run Tests

no field `cache` on type `Arc<AppContext>`

Check failure on line 130 in src/http/request_handler.rs

View workflow job for this annotation

GitHub Actions / Macro Benchmarks

no field `cache` on type `Arc<AppContext>`
};

let app_ctx = match showcase_get_app_ctx::<T>(&req, resources).await? {
let app_ctx = match showcase::create_app_ctx::<T>(&req, resources).await? {
Ok(app_ctx) => app_ctx,
Err(res) => return Ok(res),
};
Expand Down
2 changes: 1 addition & 1 deletion src/http/showcase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct ShowcaseResources {
pub cache: Arc<EntityCache>,
}

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

0 comments on commit 27c9c36

Please sign in to comment.