Commit graph

369 commits

Author SHA1 Message Date
Christian Legnitto
f3940df6d5
Add changelog entry for https://github.com/graphql-rust/juniper/pull/256 2018-09-30 11:18:21 -07:00
Jon Gjengset
ec963a6e71 Use only a single thread pool for juniper_hyper (#256)
The previous implementation used a futures_cpupool for executing
blocking juniper operations. This pool comes in addition to the
thread pool started by hyper through tokio for executing hyper's futures.
This patch uses tokio::blocking to perform the blocking juniper
operations while re-using the same thread pool as hyper, which
simplifies the API.
2018-09-30 11:07:44 -07:00
Christian Legnitto
50a9fa31b6
Add links to the book for 0.10.0 features 2018-09-13 23:33:25 -07:00
Damir Vandic
347777a8d0 Use raw url for Juniper logo in README 2018-09-13 21:06:20 +02:00
Christian Legnitto
0531bf7790
Fix README grammar 2018-09-13 11:10:02 -07:00
Christian Legnitto
be4c352939
Use the crates.io version of reqwest (#247)
This allows us to publish `juniper_hyper`
2018-09-13 10:06:03 -07:00
Christian Legnitto
e82abede94
Fix up licenses for warp and hyper integrations (#246) 2018-09-13 09:32:21 -07:00
Christian Legnitto
9c1ce1fb7a
0.10.0 release (#236)
* Bump` juniper`, `juniper_codegen`, and `juniper_tests` versions.

* Bump integration crate requirements to include 0.10.0. `juniper_iron` gets a semver breaking version as it has a breaking change but `juniper_iron` does not.

* Move `juniper_rocket` changelog into one file. This aligns with `juniper_iron` and will be easier
to automate in the future.

* Let `juniper_warp` and `juniper_hyper` use `0.9.x` versions of Juniper. They don't rely on anything in 0.10.0 so don't require it.
2018-09-13 09:13:31 -07:00
Christian Legnitto
842b2e36fe
Update README text to include warp 2018-09-07 15:42:06 -07:00
Tom Houlé
fd636e07df Add integration crate for the warp framework (#216) 2018-09-07 14:28:56 -07:00
Christian Legnitto
1ee3dab3b7
Handle InputValues that return None (#244)
Fixes https://github.com/graphql-rust/juniper/issues/242.
2018-09-07 08:27:33 -07:00
Christian Legnitto
9bee530bcd
Pretty print debugging info (#243) 2018-09-05 22:47:12 -07:00
Damir Vandic
cc9aa6e011 Fix hyper examples link in README (#241) 2018-09-05 10:51:09 -07:00
Christian Legnitto
f2f68f868a
Add failure cases to http integration tests (#239) 2018-09-02 10:59:54 -07:00
Damir Vandic
fc10b5e8f5 Update readme with link to hyper and fix link to example server (#240) 2018-09-02 10:29:47 -07:00
Damir Vandic
44002f0884 Hyper integration crate (#230)
This adds the new integration crate `juniper_hyper`.
2018-09-01 20:02:01 -07:00
Marshall Bowers
facb0d2f5d [juniper_rocket] Expose GraphQLResponse fields (#238) 2018-08-31 18:46:27 -07:00
Christian Legnitto
45004f77a3
Allow crate type paths in resolve for graphql_scalar! (#229)
Fixes https://github.com/graphql-rust/juniper/issues/227.
2018-08-27 15:26:33 -07:00
Christian Legnitto
08c31357af
Add support for lifetime annotations when using derives (#226)
Fixes https://github.com/graphql-rust/juniper/issues/225
2018-08-27 15:25:15 -07:00
Christian Legnitto
22c955599a
Add support for skipping fields in GraphQL objects (#224)
Fields can now be skipped with the `#[graphql(skip)]` annotation. Note this
doesn't really make sense for GraphQLInputObjects so this isn't supported there.

Fixes https://github.com/graphql-rust/juniper/issues/220.
2018-08-27 15:09:42 -07:00
Dirkjan Ochtman
62d015cf86 Upgrade juniper_codegen dependencies (#231)
* Upgrade `juniper_codegen` to `syn-0.14`/`quote-0.6`

* Upgrade `juniper_codegen` to `regex-1.0`

* Fix comment typos in enum derive code

* Stop testing rust-1.21.0, replace with rust-1.23.0. rust-1.21.0 breaks with the newer dependencies
2018-08-27 14:51:12 -07:00
Yusuke Sasaki
d496220e10 Use local_inner_macros to all helper macros (#233)
This enables  Rust2018-style macro imports:

```rust
use juniper::graphql_object;

graphql_object!(User: () |&self| { ... });
```

In the future when dropping compatibility with pre-2018 compilers,
this can be replaced with the explicit `$crate` prefixes instead of
`local_inner_macros`.

In `macro_rules!` with the annotation `local_inner_macros`, all of macro calls
are transformed into `$crate::builtin!(...)` (See [1] for details).
Therefore, name resolutions of built-in macros are not perfomed correctly.
To avoid this, some helper macros are introduced to make built-in
macros be interpreted as crate-local macros.

[1]: https://github.com/rust-lang/rust/issues/53464#issuecomment-414049821
2018-08-26 12:11:27 -07:00
Damir Vandic
273edc1d64 Add charset meta to GraphiQL iron integration (#228)
Fixes #223
2018-08-20 10:19:47 -07:00
Christian Legnitto
c04b06f79b
Fix bad merge (#222) 2018-08-19 08:10:18 -06:00
Damir Vandic
ec59766d51 Use 'extensions' as field for error details (#219) 2018-08-13 07:53:52 -06:00
Georg Semmler
90b89f00ee Performance improvements (#202)
Performance improvements

* Replace the IndexMap in the serialized object with a plain
  `Vec<(String, Value)>` because linear search is faster for few
  elements

* Some general tweaks to skip some allocations
2018-08-13 07:47:18 -06:00
Christoph Herzog
56f71e934b Format code 2018-07-19 16:18:49 +02:00
Christoph Herzog
39945b2b23 Update changelog (Arc<T> implements GraphQLType, ToInputValue)
Arc<T> now implements GraphQLType and ToInputValue
2018-07-19 16:18:49 +02:00
Paul Colomiets
4dc155c51a Implement GraphQLType and ToInputValue for Arc<T> 2018-07-19 16:18:49 +02:00
Christian Legnitto
915b846a83
Update CHANGELOG.md 2018-07-13 01:31:13 -07:00
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