Skip to content

Commit

Permalink
[chuchi] fix: graphiql not working on the root path
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenmeier committed Aug 17, 2024
1 parent 36e70b9 commit 006190b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions chuchi/src/extractor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ pub type PathStr = PathParam<str>;
pub struct PathParam<T: ?Sized>(T);

impl<T: ?Sized> PathParam<T> {
#[allow(clippy::needless_lifetimes)]
pub fn from_ref<'a>(s: &'a T) -> &'a Self {
// safe because `PathParam` is `repr(transparent)`
unsafe { &*(s as *const T as *const Self) }
Expand Down
3 changes: 2 additions & 1 deletion chuchi/src/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ impl Route for GraphiQl {
fn path(&self) -> RoutePath {
RoutePath {
method: Some(Method::GET),
path: format!("{}/{{*rem}}", self.uri.trim_end_matches('/')).into(),
path: format!("{}/{{*?rem}}", self.uri.trim_end_matches('/'))
.into(),
}
}

Expand Down

0 comments on commit 006190b

Please sign in to comment.