Repository: graphql-rust/juniper (language: rust)

Issue:
GraphQl Handlers break for Iron 0.5.1
The error messages I receive are: 

```
trait `for<'r, 'r, 'r> juniper::iron_handlers::GraphiQLHandler: std::ops::Fn<(&'r mut iron::request::Request<'r, 'r>,)>` not satisfied
```


```
trait `for<'r, 'r, 'r> juniper::iron_handlers::GraphiQLHandler: std::ops::FnOnce<(&'r mut iron::request::Request<'r, 'r>,)>` not satisfied
```

```
trait `for<'r, 'r, 'r> juniper::iron_handlers::GraphQLHandler<'_, _, _, _, _>: std::ops::Fn<(&'r mut iron::request::Request<'r, 'r>,)>` not satisfied
```

```
trait `for<'r, 'r, 'r> juniper::iron_handlers::GraphQLHandler<'_, _, _, _, _>: std::ops::FnOnce<(&'r mut iron::request::Request<'r, 'r>,)>` not satisfied
```





Discussion / hints:
This error is because of an iron version mismatch between your application (0.5.1) and juniper (0.4.x).

I have a patch to update iron, but it's blocked until iron-test updates to iron 0.5. If you're using your own fork of juniper, you can actually just bump juniper's iron dependency and then ignore the deprecation warnings and don't run the tests. Otherwise, I would suggest staying on iron 0.4.

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 7b681ce56..59ef4e78a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,13 +23,13 @@ expose-test-schema = []
 
 [dependencies]
 rustc-serialize = { version = "^0.3.19", optional = true }
-iron = { version = "^0.4.0", optional = true }
+iron = { version = "^0.5.1", optional = true }
 serde = { version = "^0.9.1", optional = true }
 
 [dev-dependencies]
-iron = "^0.4.0"
-router = "^0.2.0"
-mount = "^0.2.1"
-logger = "^0.1.0"
-iron-test = "^0.4.0"
+iron = "^0.5.1"
+router = "^0.5.0"
+mount = "^0.3.0"
+logger = "^0.3.0"
+iron-test = "^0.5.0"
 bencher = "^0.1.2"
diff --git a/examples/server.rs b/examples/server.rs
index bbdec804d..e4ef3cbed 100644
--- a/examples/server.rs
+++ b/examples/server.rs
@@ -30,23 +30,13 @@ fn main() {
     mount.mount("/", graphiql_endpoint);
     mount.mount("/graphql", graphql_endpoint);
 
-    let mut chain = Chain::new(mount);
+    let (logger_before, logger_after) = Logger::new(None);
 
-    setup_logger(&mut chain);
+    let mut chain = Chain::new(mount);
+    chain.link_before(logger_before);
+    chain.link_after(logger_after);
 
     let host = env::var("LISTEN").unwrap_or("0.0.0.0:8080".to_owned());
     println!("GraphQL server started on {}", host);
     Iron::new(chain).http(host.as_str()).unwrap();
 }
-
-// Temporary fix - Iron's logger middleware does not work on Windows
-#[cfg(not(windows))]
-fn setup_logger(chain: &mut Chain) {
-    let (logger_before, logger_after) = Logger::new(None);
-    chain.link_before(logger_before);
-    chain.link_after(logger_after);
-}
-
-#[cfg(windows)]
-fn setup_logger(_: &mut Chain) {
-}
diff --git a/src/integrations/iron_handlers.rs b/src/integrations/iron_handlers.rs
index c5657e8de..d7db64e7e 100644
--- a/src/integrations/iron_handlers.rs
+++ b/src/integrations/iron_handlers.rs
@@ -5,6 +5,7 @@ use iron::middleware::Handler;
 use iron::mime::Mime;
 use iron::status;
 use iron::method;
+use iron::url::Url;
 
 use std::collections::BTreeMap;
 
@@ -59,7 +60,7 @@ impl<'a, CtxFactory, Query, Mutation, CtxT>
 
 
     fn handle_get(&self, req: &mut Request) -> IronResult<Response> {
-        let url = req.url.clone().into_generic_url();
+        let url: Url = req.url.clone().into();
 
         let mut query = None;
         let variables = Variables::new();


Test patch: