It appears with newer 0.10.x hyper it no longer takes "{" or "}" in the
query string unescaped.
When I tried to set `juniper_iron` to an older hyper it complained that it
couldn't resolve due to `juniper_rocket` needing a newer version.
This was the path of least resistance. Note that we are still testing the same
thing, this change is needed as a consequence of how `iron_test` creates mock
requests.
Fixes https://github.com/graphql-rust/juniper/issues/206
* Added trait to convert a custom error type into a FieldError
* Convert the error type of the gql fields if it implements IntoFieldError
* Added test case to check if custom error handling works
* Added to changelog
GraphQL spec requires every error contain `{"message": "field"}`. Every
error in juniper except ones fixed here are reported consistently with
this style. This commit fixes ones left.
If a field has a description, we properly generate a meta field definition like:
```rust
{
let field = registry.field::<String>("id", &());
let field = field.description("Whatever");
field
}
```
If a field does not have a description, we were generating something like:
```rust
{
let field = registry.field::<String>("id", &());
let field = field; // <--- Note not needed
field
}
```
This of course works (and was likely optimized out by the compiler), but bloats
generated code for no benefit.
This change merely makes the second case generate:
```rust
{
let field = registry.field::<String>("id", &());
field
}
```
Fixes https://github.com/graphql-rust/juniper/issues/185.
* use prebuilt cargo-make for travis build
* use prebuilt cargo-make for travis build
* use prebuilt cargo-make for travis build
* use prebuilt cargo-make for travis build
* use prebuilt cargo-make for travis build
The conversions in this changeset cannot use the `From<T>` trait
implementation because the conversion is lossy, either because they
involve converting a signed value to an unsigned value (`i32`⇒`u64`)
or because the convert from a larger data type to a smaller one
(`u64`⇒`i32`). In this case, the `as` type cast is necessary to perform
a bitwise conversion.
This coercion can cause negative values to become very large unsigned
values. This is intentional on line 90.
It doesn't appear that `:tt` accepts the `stringify!()`-ed value in this
position. The :tt is only later used as an `:expr` to produce the name
for metadata purposes.
Converting this position to be an `:expr` allows the `stringify!()`-ed
value and accepts all current uses of the `graphql_scalar!()` macro in
this repository.
Fix chrono DateTime support
The DateTime support was improperly implemented with time (hour + minute support), which is fixed by this commit.
Documentation and tests have also been updated.
Only author: @sporto
Without this change tests were failing to compile:
```
---- src/value.rs - graphql_value (line 196) stdout ----
error[E0468]: an `extern crate` loading macros must be at the crate root
--> src/value.rs:197:14
|
3 | #[macro_use] extern crate juniper;
| ^^^^^^^^^^^^^^^^^^^^^
thread 'rustc' panicked at 'couldn't compile the test', librustdoc/test.rs:295:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
I also confirmed that `main` does not show up in the docs with
this change.