From 95dc436bb313ac3031b3dc4d9f3462b1842e2c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Houl=C3=A9?= <tom@tomhoule.com> Date: Tue, 23 Oct 2018 06:05:01 +0200 Subject: [PATCH] Rename graphiql_handler to graphiql_filter in juniper_warp (#267) This is a more idiomatic name for warp, and it _is_ a filter. --- juniper_warp/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/juniper_warp/src/lib.rs b/juniper_warp/src/lib.rs index d844be66..29db681e 100644 --- a/juniper_warp/src/lib.rs +++ b/juniper_warp/src/lib.rs @@ -293,13 +293,13 @@ fn build_response( /// # extern crate juniper_warp; /// # /// # use warp::Filter; -/// # use juniper_warp::graphiql_handler; +/// # use juniper_warp::graphiql_filter; /// # /// # fn main() { -/// let graphiql_route = warp::path("graphiql").and(graphiql_handler("/graphql")); +/// let graphiql_route = warp::path("graphiql").and(graphiql_filter("/graphql")); /// # } /// ``` -pub fn graphiql_handler( +pub fn graphiql_filter( graphql_endpoint_url: &'static str, ) -> warp::filters::BoxedFilter<(warp::http::Response<Vec<u8>>,)> { warp::any() @@ -329,7 +329,7 @@ mod tests { fn graphiql_endpoint_matches() { let filter = warp::get2() .and(warp::path("graphiql")) - .and(graphiql_handler("/graphql")); + .and(graphiql_filter("/graphql")); let result = request() .method("GET") .path("/graphiql") @@ -344,7 +344,7 @@ mod tests { let filter = warp::get2() .and(warp::path("dogs-api")) .and(warp::path("graphiql")) - .and(graphiql_handler("/dogs-api/graphql")); + .and(graphiql_filter("/dogs-api/graphql")); let response = request() .method("GET") .path("/dogs-api/graphiql")