Commit graph

1239 commits

Author SHA1 Message Date
Andrey Kutejko
e63b42bc8e (juniper_iron) fallible context factory (#180) 2018-07-13 01:30:14 -07:00
Christian Legnitto
521930e911
Escape urls in iron integration tests (#208)
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
2018-07-12 18:34:37 -07:00
Sharad Chand
f115d0bb57 Allow custom errors to be returned from queries, mutations (#205)
* 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
2018-07-12 18:24:29 -07:00
Paul Colomiets
2e9408e5f6 Consistent error serializing for GraphQLError (#207)
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.
2018-07-10 08:07:18 -07:00
Sharad Chand
569bc16415 Don't make assumptions what features the rocket app might use. (#204) 2018-07-06 08:10:08 -07:00
Christian Legnitto
4be687f73e Add more unit tests for doc comments as descriptions 2018-06-20 20:45:34 +02:00
Christian Legnitto
1fd5c10327 Add support for using doc comments as descriptions
Fixes https://github.com/graphql-rust/juniper/issues/194.
2018-06-20 20:45:34 +02:00
Cameron Eldridge
e84167286b Handle an array of GraphQL queries (#171) 2018-06-07 17:44:30 -07:00
Christian Legnitto
f0cbc97dc7
Do not assign field to itself if no description specified when deriving input object (#187)
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.
2018-06-06 18:40:45 -07:00
Sagie Gur-Ari
d5d57f8a10 use prebuilt cargo-make for travis build (#193)
* 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
2018-06-01 09:25:18 -07:00
Kevin Stenerson
f2d228b8ae Add helpers to build custom GraphQLResponse (#158) 2018-05-29 23:28:36 -07:00
Christian Legnitto
7933bf92a5
Rename variable to be more descriptive. 2018-05-23 00:49:23 -07:00
piperRyan
9080448da2 Add Compile Time Check For "Invalid" Names (#170) 2018-05-23 00:25:20 -07:00
Paul Colomiets
69db4c247b Deserialize large integers as InputValue::float (fixes #178) 2018-05-23 00:21:57 -07:00
Georg Semmler
34391855af Fix imports 2018-05-20 15:55:34 +02:00
Georg Semmler
19e76865c9 Remove unused type_name field to fix tests 2018-05-20 15:55:34 +02:00
Georg Semmler
cfc3109109 Rename childs to children 2018-05-20 15:55:34 +02:00
Georg Semmler
da9c21ccfe Add some documentation to the lookahead feature 2018-05-20 15:55:34 +02:00
Georg Semmler
61c07b95fc Small improvements + rustfmt 2018-05-20 15:55:34 +02:00
Georg Semmler
dd99914fbe Add a basic lookahead functionality 2018-05-20 15:55:34 +02:00
theduke
61f0c7d337
Update uuid version range
Allow 0.5 and 0.6
2018-05-10 06:43:28 +02:00
Christoph Herzog
9313c7ca6d Run rust fmt. 2018-05-03 07:38:10 +02:00
Marcus Griep
b94ed37c1f Remove unnecessary format!()
The `E::custom()` function requires a value of any type that implements
`fmt::Display`, so a plain `&str` works just fine here.
2018-05-03 07:27:15 +02:00
Marcus Griep
d1cddfb55f Revert lossy conversions to use as
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.
2018-05-03 07:27:15 +02:00
Marcus Griep
73a4efe984 Change $outname from :tt to :expr
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.
2018-05-03 07:27:15 +02:00
Atul Bhosale
875c80748d Fix cargo clippy warnings 2018-05-03 07:27:15 +02:00
Atul Bhosale
ea3c425f04 Replace try! with ? 2018-05-03 07:27:15 +02:00
Christoph Herzog
05c1011d83 (juniper_codegen) Upgrade syn + quote 2018-05-03 01:49:36 +02:00
Christoph Herzog
3df18f41f8 (juniper_rocket) Bump minimum rocket version to 0.3.9
Needed to bump minimum version to allow working on latest nightly.
2018-05-03 01:19:52 +02:00
theduke
3b445f0577
Add link to actix-web example 2018-04-29 14:58:38 +02:00
Christian Legnitto
218654ee97 Switch to indexmap 1.0
`ordermap` changed names to `indexmap` and released a stable 1.0.
2018-04-22 07:49:05 +02:00
Christian Legnitto
254a61c0e0 Update changelog for NaiveDate serialization change (#160) 2018-03-29 05:57:28 +02:00
Georg Semmler
2ea7d9b46e Allow graphiql to pass credentials to the server (#162) 2018-03-29 05:02:46 +02:00
Sebastian Porto
841fd7e26d Change serialization of Chronos NaiveDate (#151)
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
2018-03-21 17:52:22 +01:00
Carlos Diaz-Padron
63d8a3d1a0 Handle list merging 2018-03-05 12:02:22 +01:00
Carlos Diaz-Padron
509a6f12b9 Fix merging parallel inline fragments 2018-03-05 12:02:22 +01:00
Christian Legnitto
28763a5639 Fix warning in iron_juniper
The warning was:

```
warning: unnecessary parentheses around function argument
   --> juniper_iron/src/lib.rs:268:43
    |
268 |             _ => return Ok(Response::with((status::MethodNotAllowed))),
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
    |
    = note: #[warn(unused_parens)] on by default
```
2018-02-21 15:07:37 +01:00
Christian Legnitto
0cc11a0dbe Make tests compile on latest nightly
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.
2018-02-21 09:40:42 +01:00
Christoph Herzog
47575ef922 Prepare juniper_iron 0.1.2 release 2018-02-10 13:59:04 +01:00
Matrix
d9677b38df (iron) Update to iron 0.6
* Allow both iron 0.5 and 0.6
* Allow both urlencoded 0.5 and 0.6
2018-02-08 22:56:19 +01:00
Sackery
10538eca8b Change pretty json string to compact json string 2018-02-08 21:05:00 +01:00
Ivan Dubrov
bfe2ef511a Provide type info to the concrete_type_name 2018-01-20 10:53:18 +01:00
Christoph Herzog
d00e74bb4e Format entire codebase with rustfmt 2018-01-13 12:25:55 +01:00
Christoph Herzog
406bdaa55c Update embedded graphiql + move graphiql to http module
* Update graphiql to 0.11 and react to v16.
* Move graphiql to be a submodule of http
2018-01-13 11:44:36 +01:00
Christoph Herzog
5c976ba60d (ci) Update Rust versions built on travis
Since Rust 1.23 was released, only build 1.22 and 1.21 now.
2018-01-13 10:43:21 +01:00
Christoph Herzog
40c946c81c 0.9.2 release
* Changelogs
* Update versions and dependency versions
2018-01-13 10:34:30 +01:00
Christoph Herzog
5670fc7eb1 add decode query params to 0.1.2 changelog. 2018-01-13 10:02:43 +01:00
Christian Legnitto
9362d6954c url_decode parameters in Rocket integration
Also as part of this change I fixed and enabled
the http integration tests for Rocket.

Fixes https://github.com/graphql-rust/juniper/issues/116.
2018-01-13 08:50:13 +00:00
Christoph Herzog
883dd0b2ee juniper_rocket 0.1.2 release
* Bump version
* fix up changelog
2018-01-13 09:42:01 +01:00
sagie gur ari
23cf596748 windows build 2018-01-13 08:36:08 +00:00