Commit graph

563 commits

Author SHA1 Message Date
Aaron Housh
e5f655044e
Add debug derive to GraphQLResponse (#599) 2020-04-04 17:27:11 -10:00
Christian Legnitto
adc8d7be2d
Fix some clippy warnings (#595) 2020-03-31 08:34:50 -07:00
Samuel Hurel
6e4bc127b0
Add support for bson::UtcDateTime (#585) 2020-03-24 17:21:05 -07:00
Jade Devin Cabatlao
cab6decdbc
Implement GraphQLTypeAsync for Box (#582) 2020-03-21 22:04:58 -07:00
Gero Posmyk-Leinemann
5f777e8a6d
Clippy cleanup (#579) 2020-03-20 09:11:06 -07:00
nWacky
eb941e509a
Add subscription support (#433)
Co-authored-by: tyranron <tyranron@gmail.com>
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-03-18 20:31:36 -07:00
Jade Devin Cabatlao
b7cc424bff
Expose SchemaType (#569)
Executor.schema(&self) is kind of useless without declaring SchemaType as public
2020-03-17 22:28:40 -07:00
Christian Legnitto
27e00419b0
More clippy and warnings. (#568)
Also, remove `dbg!()`
2020-03-14 08:55:06 -07:00
Christian Legnitto
f247dbee48
Fix most warnings (#567) 2020-03-14 00:01:02 -07:00
Christian Legnitto
2796d8df9a
More clippy fixes (#565) 2020-03-13 23:02:43 -07:00
Christian Legnitto
3b5cf4ad64
Fix some clippy lints (#564)
* Fix some clippy lints
2020-03-13 22:03:36 -07:00
Tommaso Checchi
fd4290462c
Require serde_json when enabling expose-test-schema (#527)
I noticed that `juniper` fails to build if the `"expose-test-schema"` feature is enabled without also enabling `"serde_json"`. I guess it might make sense to add it as a dependency so people don't have to check this file to figure that out!

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-03-13 21:38:10 -07:00
Christian Legnitto
bc7e5bac13
Add docs to silence warnings for async (#563) 2020-03-13 19:34:22 -07:00
Christian Legnitto
48c924ea27
Async tests (#559)
Convert more tests to async
2020-03-10 19:11:40 -07:00
Christian Legnitto
961a07125f
Convert more tests to async (#558) 2020-03-10 00:12:09 -07:00
Christian Legnitto
bdaa77053d
Fix field_execution and merge_parallel_inline_fragments tests under async (#557)
The ordering was off when run under async. Not 100% sure I understand this code but this seems
to work.
2020-03-09 23:40:54 -07:00
Christian Legnitto
e9b8aa2c38
Rename execute -> execute_sync, execute_async -> execute (#556) 2020-03-09 22:40:26 -07:00
Christian Legnitto
00b111a1ff
Remove async feature gate (#554)
This still has the async / non-async split. Future diffs will get
rid of `GraphQLTypeAsync` and move everything into `GraphQLType`.
2020-03-08 23:20:11 -07:00
David Pedersen
ca28e90f7e
Implement std::error::Error for all error types (#419)
* Implement `std::error::Error` for all error types

* Fix copy-paste

* Implement `Display` for `Value`

This is required for implementing `Display` for `FieldError`

* Implement `std::error::Error` for `FieldError`

This required removing `impl From<T> for FieldError where T: Display`
because it would otherwise cause a conflicting implementation. That is
because `impl From<T> for T` already exists.

Instead I added `impl From<String> for FieldError` and `impl From<&str>
for FieldError` which should cover most use cases of the previous
  `impl`. I also added `FieldError::from_error` so users can convert
  from any error they may have.

* Bring back `impl<T: Display, S> From<T> for FieldError<S>`

We cannot have this and `impl<S> std::error::Error for FieldError<S>` so
we agreed this is more valuable. More context https://github.com/graphql-rust/juniper/pull/419

* Write errors without allocations
2020-02-20 22:31:58 -07:00
Nathan Wilson
389fd5ca19
Add bson crate's ObjectId to juniper foreign scalar type integrations (#517) 2020-02-12 23:49:50 -07:00
Jordão
75b597d8f3 Added usage of context validator in the async executor 2020-02-05 18:10:43 -08:00
tyranron
c51c675306
Use caret requirement for specifying 'futures' crate version 2020-02-04 09:57:47 +01:00
tyranron
dd9c201352 Upgrade uuid to 0.8 version 2020-01-29 01:59:42 -05:00
Christian Legnitto
c984457e91 Fix scalar and some tests under async
there is still some weirdness going on. Running async and
non-async tests in `integration_tests/*` works, but running it
from `integration_tests` does not.
2020-01-27 23:41:38 -05:00
Christian Legnitto
c42c71b02d Update to latest tokio 2020-01-22 07:56:03 -08:00
Christian Legnitto
e97d25d650 Fix formatting 2020-01-20 23:29:29 -08:00
Christian Legnitto
7681f42933 Merge remote-tracking branch 'upstream/master' into async-await 2020-01-20 22:47:05 -08:00
iancormac84
001cabc9e9 Changes. 2020-01-18 17:14:35 -08:00
iancormac84
c6ac0bdcef Add changes from async-await branch to Changelog. 2020-01-18 17:14:35 -08:00
Christian Legnitto
73dc5cd5b8 Release juniper 0.14.2 2020-01-18 17:14:35 -08:00
Christian Legnitto
a5ccf8c2a1 Release juniper_codegen 0.14.2 2020-01-18 17:14:35 -08:00
Christian Legnitto
3c41769cb7 Update quickstart on every release (#485) 2020-01-18 17:14:35 -08:00
Massimo Cairo
9fe1c29889 Validate variables of the executed operation only (#462)
* Validate variables of the executed operation only

* Use `unreachable!` in `validate_var_defs`.

Use `unreachable!` instead of `panic!` on invalid variable types,
since thay have already been checked during document validation.

* Fix formatting in `validation/input_value.rs`
2020-01-18 17:14:35 -08:00
Alexander Simmerl
16967d7d98 Add example of how to construct null in graphql_value 2020-01-18 17:14:35 -08:00
Massimo Cairo
d4c75f0ba5 Fix unused variable error message
Was copied from undefined variable error message.
2020-01-18 17:14:35 -08:00
Jens Krause
14986ff419 Use latest graphiql (v0.17.2) (#477)
incl. upgrade to latest React
2020-01-18 17:14:35 -08:00
Jens Krause
c342ecf73a Use latest graphql-playground (#476) 2020-01-18 17:14:35 -08:00
James Harton
bc9183784f Loosen constraints on uuid version.
The `uuid` maintainers have started releasing in the `0.8` version train.  I've relaxed the version requirements on `juniper`'s dependencies to allow juniper users to specify a different version in their `Cargo.toml` and still have the integration work.
2020-01-18 17:14:35 -08:00
Corey Farwell
758c7967d4 Bump to latest graphiql (#489)
https://github.com/graphql/graphiql/releases
2020-01-07 22:19:29 -08:00
Graeme Coupar
c2f0dd2aec Implement GraphQLTypeAsync for Arc (#479)
* Implement GraphQLTypeAsync for Arc

I'm building a GraphQL API using Juniper that proxies another GraphQL
API.  It does a large fetch upfront from the underlying GraphQL API,
transforms it into a different format and then implements some
resolvers that do some further filtering.

One of these resolvers ends up looking like:

```
async fn items(&self, ...) -> Vec<Item> {
    self.items.iter().filter(...).collect()
}
```

This causes us problems as we're returning owned Item's and Item is a
large nested structure that would be expensive to clone.

Our current work around was to put Item into an Arc, as Arc is
comparatively cheap to clone.  So our method becomes:

```
async fn items(&self, ...) -> Vec<Arc<Item>> {
    self.items.iter().filter(...).map(Arc::clone).collect()
}
```

However to support this we needed Arc to implement GraphQLTypeAsync.
This commit adds that support to juniper, by forwarding to the
GraphQLTypeAsync implementation for the contained type.

It's possible that we could have acheived something similar by adding
some lifetimes to our resolver and returning a reference, but using an
Arc was easier for us in this case.  I'm not sure if there's any reason
why this would be a bad addition to Juniper overall?

* Move GraphQLTypeAsync for Arc<T> into pointers.rs
2019-12-22 14:54:03 -08:00
danieleades
6fa6c20fa7 address clippy::all lints (#486) 2019-12-17 20:37:46 -08:00
Christian Legnitto
eddf948dad Release juniper 0.14.2 2019-12-16 21:53:51 -08:00
Christian Legnitto
e4cfc4b09f Release juniper_codegen 0.14.2 2019-12-16 21:52:50 -08:00
Christian Legnitto
cd0142ff52
Update quickstart on every release (#485) 2019-12-16 21:47:48 -08:00
Massimo Cairo
675ae060f3 Validate variables of the executed operation only (#462)
* Validate variables of the executed operation only

* Use `unreachable!` in `validate_var_defs`.

Use `unreachable!` instead of `panic!` on invalid variable types,
since thay have already been checked during document validation.

* Fix formatting in `validation/input_value.rs`
2019-12-16 00:17:13 -08:00
Alexander Simmerl
26bfe7652f
Add example of how to construct null in graphql_value 2019-12-15 13:31:24 +01:00
David Pedersen
3a6d5e6a46
Merge pull request #481 from cairomassimo/fix-unused-variable-error-message
Small fix/typo: unused variable error message
2019-12-11 18:00:38 +01:00
Massimo Cairo
8f1bf8c661 Fix unused variable error message
Was copied from undefined variable error message.
2019-12-11 17:27:06 +01:00
Jens Krause
93f3dc3d72 Use latest graphiql (v0.17.2) (#477)
incl. upgrade to latest React
2019-12-09 10:36:09 -08:00
Jens Krause
38ee6edb9e Use latest graphql-playground (#476) 2019-12-09 10:34:31 -08:00
James Harton
5d56c9f221 Loosen constraints on uuid version.
The `uuid` maintainers have started releasing in the `0.8` version train.  I've relaxed the version requirements on `juniper`'s dependencies to allow juniper users to specify a different version in their `Cargo.toml` and still have the integration work.
2019-12-01 14:27:41 +01:00
Christoph Herzog
ce3cf45ca9 Rename object proc macro to graphql_object 2019-11-16 02:57:48 +01:00
Christoph Herzog
a31d3f3888 Remove old graphql_object! macro 2019-11-16 02:33:20 +01:00
Christoph Herzog
358071bfa4 Remove deprecated ScalarValue derive
This was renamed to GraphQLScalarValue and has been deprecated for a
while
2019-11-16 02:33:20 +01:00
Christoph Herzog
9ce3d04007 Improve union proc macro
* Rename to graphql_union
* Implement full-featured parsing and code generation
2019-11-16 02:33:18 +01:00
Christoph Herzog
6861951a1e Disable async tests for juniper 2019-11-15 22:36:25 +01:00
Christoph Herzog
27e5e447c7 Fix pattern move error on stable 2019-11-15 22:34:08 +01:00
Christoph Herzog
641e87a0b6 Add back documentation for graphql_scalar! macro 2019-11-15 22:18:39 +01:00
Christoph Herzog
4f287806bd Update CHANGELOG with master breaking changes 2019-11-15 22:18:39 +01:00
Christoph Herzog
5d270b7dea Formatting 2019-11-15 22:18:38 +01:00
Christoph Herzog
f6c0bc7b02 Fix tests. 2019-11-15 21:44:08 +01:00
Christoph Herzog
b634ad39eb Various async feature fixes for the type system 2019-11-15 21:23:59 +01:00
Christoph Herzog
ad16093b88 Refactor GraphQLType::resolve to return Result<>
This unifies the output type of all resolvers.

Required for future step of making the output a associated type.
2019-11-14 09:51:32 +01:00
Christoph Herzog
6fcdd32c84 Remove GraphQLType ScalarValue default
This is more hinderance than useful.
2019-11-14 01:31:14 +01:00
Christoph Herzog
36c71d7162 chore: Remove ScalarRefValue trait
The trait was introduced while introducing generic scalars, but is not
actually required or useful. It's functionality is fully covered by
methods on the `ScalarValue` trait.

It also forced a lof of for<'a> ScalarRefValue bounds all over the code,
complicating signatures a lot.

It is completely removed now.
2019-11-14 01:21:41 +01:00
nWacky
2144ad0d7d Remove async-trait [skip ci] 2019-11-13 14:26:25 +00:00
nWacky
a5580a939d Update most crates to futures 0.3, add todos on not updated crates 2019-11-12 12:04:09 +00:00
nWacky
cf99495368 Replace all futures::BoxFuture with juniper::BoxFuture 2019-11-12 12:04:09 +00:00
nWacky
237e69c036 Rebase async_await onto master (#454)
* feat: Raw identifier support in object macro

This commit implements raw identifier (`r#name`) support
for field names (methods) and arguments in the `object` proc macro.

Eg:

```rust
impl T {
  fn r#type(r#trait: String) -> bool {}
}
```

* Rebase onto master

* Fix merge [skip ci]
2019-11-08 09:46:48 +00:00
David Pedersen
1148c75a1d feat: Raw identifier support in object macro
This commit implements raw identifier (`r#name`) support
for field names (methods) and arguments in the `object` proc macro.

Eg:

```rust
impl T {
  fn r#type(r#trait: String) -> bool {}
}
```
2019-11-06 23:08:25 +00:00
nWacky
778606c050
Fix bad merge [skip ci] 2019-11-06 12:01:50 +03:00
nWacky
e344f1c06f
Merge branch 'async-await-resolve-some-todos' of https://github.com/instrumentisto/juniper into async-await-resolve-some-todos
# Conflicts:
#	juniper/src/macros/tests/args.rs
[skip ci]
2019-11-06 11:46:21 +03:00
nWacky
09d9513da9
Rebase onto master 2019-11-06 11:45:19 +03:00
nWacky
4834349310
Rebase onto async-await 2019-11-06 11:21:06 +03:00
nWacky
e151026cfa
Merge branch 'async-await-resolve-some-todos' of https://github.com/instrumentisto/juniper into async-await-resolve-some-todos
# Conflicts:
#	examples/warp_async/Cargo.toml
#	juniper/src/macros/tests/args.rs
#	juniper_codegen/src/util.rs
[skip ci]
2019-11-05 12:10:04 +03:00
nWacky
99c0d26887
Comment out attr_arg_descr and attr_arg_descr_collapse tests 2019-11-05 12:06:08 +03:00
nWacky
7135c07ae5
Format 2019-11-05 11:20:08 +03:00
nWacky
9506272b82
Merge import in async_await 2019-11-05 11:20:07 +03:00
nWacky
554ba34df1
Format 2019-11-05 11:20:07 +03:00
nWacky
dbcaf30ec3
Rebase onto master 2019-11-05 11:20:06 +03:00
nWacky
e3c12e31fc
Format 2019-11-05 11:14:53 +03:00
nWacky
b1970aecd2
Remove useless todo 2019-11-05 11:14:20 +03:00
nWacky
52c3e281f3
Refactor GraphQLTypeAsync to use async-trait 2019-11-05 11:14:20 +03:00
nWacky
820f472f2c
Add resolve_into_type_async 2019-11-05 11:14:19 +03:00
nWacky
e03e525645
Start adding async-trait to GraphQLTypeAsync 2019-11-05 11:14:19 +03:00
nWacky
bfe6c7ae97
Remove __juniper_extract_generic macro 2019-11-05 11:14:18 +03:00
nWacky
d22b5c68f3
Resolve RFC 2565 related todos 2019-11-05 11:14:18 +03:00
Christian Legnitto
191468bf04
Release juniper 0.14.1 2019-11-05 11:14:16 +03:00
Christian Legnitto
7b18bd245d
Release juniper_codegen 0.14.1 2019-11-05 11:14:15 +03:00
Christian Legnitto
bb99076326
Update CHANGELOG.md 2019-11-05 11:14:15 +03:00
Christian Legnitto
665c3d2eb6
Make EmptyMutation Send 2019-11-05 11:14:15 +03:00
Christian Legnitto
7230efc3b9
Update CHANGELOG.md 2019-11-05 11:14:14 +03:00
Andrey Kutejko
779208eea5
Bubble up scalar error (#434) 2019-11-05 11:14:14 +03:00
nWacky
3e5e2aeeb7
Format 2019-11-04 19:13:06 +03:00
nWacky
e2ebaeec3a
Merge import in async_await 2019-11-04 19:11:12 +03:00
nWacky
503bb6357f
Format 2019-11-04 19:07:25 +03:00
nWacky
09d1077735
Merge branch 'async-await-resolve-some-todos' of https://github.com/instrumentisto/juniper into async-await-resolve-some-todos 2019-11-04 18:53:42 +03:00
nWacky
2404b81008
Rebase onto master 2019-11-04 18:52:26 +03:00
nWacky
afd92cd7fe
Format 2019-11-04 16:55:36 +03:00
nWacky
9478b6c590
Remove useless todo 2019-11-04 11:40:52 +03:00
Christian Legnitto
34c380b7af cargo fmt 2019-11-03 22:23:46 -08:00
Christian Legnitto
cdf9fb333d Re-enable introspection tests.
These were fixed by previous commits.
2019-11-03 22:23:07 -08:00
Christian Legnitto
ef2277c80f Update delay to latest tokio usage 2019-11-03 22:08:33 -08:00
Christian Legnitto
560a172587 Make resolvers with returns work again
Note that this only fixes the non-async case
2019-11-03 22:07:40 -08:00
nWacky
9e2a63ab81
Refactor GraphQLTypeAsync to use async-trait 2019-11-01 19:37:55 +03:00
nWacky
737c4c7184
Add resolve_into_type_async 2019-11-01 17:51:25 +03:00
nWacky
13bbbe254b
Start adding async-trait to GraphQLTypeAsync 2019-11-01 14:26:08 +03:00
nWacky
0f4e9982c5
Remove __juniper_extract_generic macro 2019-11-01 13:43:01 +03:00
nWacky
bd3d289d59
Resolve RFC 2565 related todos 2019-11-01 13:29:11 +03:00
Christoph Herzog
ee9a82a817 Refacto graphql_union! macro to proc macro 2019-10-28 21:51:29 +01:00
Christian Legnitto
c434bddc91 Release juniper 0.14.1 2019-10-24 15:57:16 -07:00
Christian Legnitto
252f7b4353 Release juniper_codegen 0.14.1 2019-10-24 15:56:44 -07:00
Christian Legnitto
6b7977b8dd
Update CHANGELOG.md 2019-10-24 15:55:37 -07:00
Christian Legnitto
8628dddaf0 Make EmptyMutation Send 2019-10-24 20:33:48 +02:00
Christian Legnitto
9be274ae77
Update CHANGELOG.md 2019-10-23 21:38:37 -07:00
Andrey Kutejko
dd424f3579 Bubble up scalar error (#434) 2019-10-23 18:04:48 -07:00
tyranron
e2903cf0f7
Fix type inferring for trivial resolver code
Additionally:
- fix inconsistencies after merge with master
2019-10-10 14:50:10 +02:00
tyranron
635bf1ff34
Merge branch 'async-await' into remove-async-closure-feature
# Conflicts:
#	examples/warp_async/src/main.rs
#	integration_tests/async_await/src/main.rs
#	juniper/src/lib.rs
#	juniper_benchmarks/src/lib.rs
#	juniper_rocket/src/lib.rs
#	juniper_warp/src/lib.rs
2019-10-10 13:20:00 +02:00
Christian Legnitto
2884ef313b
Merge branch 'async-await' into async-await-rebase 2019-10-09 22:43:07 -07:00
Kai Ren
8d33e8db12 Upgrade futures-preview, tokio crates and remove unnecessary 'async_await' feature (#436) 2019-10-09 22:22:13 -07:00
Christian Legnitto
045c1870ef Replace futures::future::FutureExt::boxed with Box::pin 2019-10-09 22:22:13 -07:00
Christoph Herzog
c270c038ef Enable merge_imports rustfmt setting.
style: Enable rustfmt merge_imports and format

This commit enables the rustfmt merge_imports setting
and formats the whole code base accordingly.

Note that the setting is not stable yet, but will be with Rust 1.38.

In the meantime, running fmt on stable will just leave the
changes alone so no problems should occur.
2019-10-09 22:22:13 -07:00
Graeme Coupar
67480d176b Fix juniper issue 2019-10-09 22:22:13 -07:00
Christoph Herzog
4a4d7407aa Use Custom BoxFuture type + prepare new resolve result value 2019-10-09 22:22:13 -07:00
Christoph Herzog
c113ef6171 Experimental benchmarks 2019-10-09 22:22:13 -07:00
Christoph Herzog
3d9fc8e347 examples/warp_async: update dependency paths 2019-10-09 22:22:13 -07:00
Christoph Herzog
92871a9253 Update warp for async 2019-10-09 22:22:13 -07:00
Christoph Herzog
56a4f2558a WIP async/await implementation 2019-10-09 22:22:13 -07:00
Kai Ren
2cf991697c Upgrade futures-preview, tokio crates and remove unnecessary 'async_await' feature (#436) 2019-10-09 22:14:45 -07:00
tyranron
5d3ed9ac72
Remove async_closure feature usage 2019-10-10 00:07:10 +02:00
tyranron
639c29e91e
Upgrade futures-preview, tokio crates and remove unnecessary 'async_await' feature 2019-10-09 20:11:34 +02:00
Christian Legnitto
dbbceae643 Release juniper 0.14.0 2019-09-29 19:04:31 -07:00
Christian Legnitto
c4d7661b3b Release juniper_codegen 0.14.0 2019-09-29 19:03:54 -07:00
Christian Legnitto
02fd164e96
Update url dependency (#432) 2019-09-29 18:47:37 -07:00
James Harton
5be66654a9 Improve visitability of lookahead types. (#431)
I've added methods which allow Juniper users to visit all nodes of a lookahead tree so that they can be used for query generation.
2019-09-29 18:00:45 -07:00
nWacky
b61aa900b1 Add subscription support to query parser (#430) 2019-09-29 17:43:56 -07:00
Christian Legnitto
b08d1af7a4 Replace futures::future::FutureExt::boxed with Box::pin 2019-08-26 21:37:38 -07:00
Christoph Herzog
37e35c0180 Enable merge_imports rustfmt setting.
style: Enable rustfmt merge_imports and format

This commit enables the rustfmt merge_imports setting
and formats the whole code base accordingly.

Note that the setting is not stable yet, but will be with Rust 1.38.

In the meantime, running fmt on stable will just leave the
changes alone so no problems should occur.
2019-08-26 20:57:25 -07:00
Graeme Coupar
ab37f647db Fix juniper issue 2019-08-22 10:38:01 +01:00
Christoph Herzog
4940085c44 Use Custom BoxFuture type + prepare new resolve result value 2019-08-21 15:51:18 +02:00
Christoph Herzog
acd1442cea Experimental benchmarks 2019-08-21 15:48:31 +02:00
Christoph Herzog
ef3720cb67 examples/warp_async: update dependency paths 2019-08-21 15:48:31 +02:00
Christoph Herzog
f730829c1b Update warp for async 2019-08-21 15:48:31 +02:00
Christoph Herzog
a14f0ddebd WIP async/await implementation 2019-08-21 15:48:31 +02:00
Christoph Herzog
835dee1a8e Enable merge_imports rustfmt setting.
style: Enable rustfmt merge_imports and format

This commit enables the rustfmt merge_imports setting
and formats the whole code base accordingly.

Note that the setting is not stable yet, but will be with Rust 1.38.

In the meantime, running fmt on stable will just leave the
changes alone so no problems should occur.
2019-08-21 15:42:16 +02:00
Christian Legnitto
752584fbbd
Add myself as an author 2019-07-29 08:16:50 -07:00
Christian Legnitto
48c26a26b3 Release juniper 0.13.1 2019-07-29 08:08:05 -07:00
Christian Legnitto
6b32e90899 Release juniper_codegen 0.13.2 2019-07-29 08:07:32 -07:00
Christian Legnitto
644d6042ae Release juniper_codegen 0.13.1 2019-07-29 08:06:22 -07:00
Christian Legnitto
49fc100753
Add #404 to changelog (#406) 2019-07-29 08:57:32 -06:00
Christian Legnitto
4016d38d3d Don't assume lookaheads are always fields
Fixes https://github.com/graphql-rust/juniper/issues/398.
2019-07-25 03:42:11 +02:00
Christoph Herzog
049ba0c9dc (codegen) Respect mut modifier on arguments in object proc macro
This commit forwards `mut` declaration of arguments in a #[juniper::object] macro invocation
to the generated code.

Closes #399
2019-07-24 02:37:31 +02:00
Christoph Herzog
9e849fe512 Fix broken doc link.
Closes #400
2019-07-22 21:49:02 +02:00
Christian Legnitto
54f98f46db Release juniper 0.13.0 2019-07-19 14:01:21 -07:00
Christian Legnitto
efe22b7ffd Release juniper_codegen 0.13.0 2019-07-19 14:01:21 -07:00
Christian Legnitto
5065eb2265
Fix lookahead when query contains multiple fields (#393)
Fixes https://github.com/graphql-rust/juniper/issues/371.
2019-07-17 18:57:14 -07:00
Christian Legnitto
7bedea05ed
Clean up test warnings (#392) 2019-07-15 21:47:16 -07:00
Peter Majchrak
3373935046 Add support for "dyn" trait object syntax (#385)
* Use "dyn" for TraitObjects

* Cleanup after adding "dyn" support

* Add entry to CHANGELOG.md
2019-06-27 08:44:30 -07:00
Christoph Herzog
97e1005178 Clean up ScalarValue transparent derive argument handling and documentation. 2019-06-25 18:55:45 +02:00
Christoph Herzog
3396074274 (codegen) Implement newtype derive for scalars.
This commit implements a newtype style custom derive
for scalars via `#[derive(GraphQLScalarValue)]`, which now
supports both deriving a base enum scalar type and newtypes.

For newtypes, the `#[graphql(transparent)]` attribute is
required.

This commit:
* implements the derive
* adds integration tests
* updates the book
2019-06-25 18:55:45 +02:00
jekshmek
675f34bc46 Fix test_invalid_field juniper::http (#380) 2019-06-24 23:08:36 -07:00
Kai Ren
49f723a3dd Optimize .unwrap_or() and .expect() usages (#374) 2019-06-18 23:12:13 -04:00
Jean Mertz
3456786463 Implement Serialize/Deserialize for ID scalar
As per the unofficial Rust API guidelines:

https://rust-lang-nursery.github.io/api-guidelines/interoperability.html#data-structures-implement-serdes-serialize-deserialize-c-serde
2019-05-23 15:49:15 +02:00
Andrey Kutejko
5b9a0bd31b Split Query and Database types in example schema (#360) 2019-05-18 09:07:51 -07:00
Christian Legnitto
9c9e3da72d Release juniper 0.12.0 2019-05-16 19:03:21 -07:00
Christian Legnitto
8a047e8702 Release juniper_codegen 0.12.0 2019-05-16 19:01:52 -07:00
theduke
d47aa990ba Remove GraphQLType impl for unit () type (#355)
This impl can cause weird runtime errors and serves
no real practical purpose.

Removing the impl is a breaking change but is the only
way to error out at runtime.
2019-05-16 07:22:13 -07:00
David Pedersen
2518eff0c9 Expose the operation name from juniper_rocket::GraphQLRequest (#353)
Measuring the runtime of queries will only tell if there are slow
queries. To find out which queries are slow you need the operation name.

Getting the operation name was previously not possible from a Rocket
request handler. This fixes that.
2019-05-15 07:26:40 -07:00
Christoph Herzog
166c6d00c5 (tooling) Update release config to bump doc_root. 2019-05-15 11:20:51 +02:00
Yusuke Sasaki
0ae2475bb8 add #[doc(html_root_url)] to all published crates 2019-05-15 11:20:51 +02:00
Christoph Herzog
29025e6cae
Rename impl_object to object. 2019-05-13 21:15:14 +02:00
Christoph Herzog
520cac29a0
(codegen) Allow #[deprecated] on field in impl_object 2019-05-13 12:37:22 +02:00
Christoph Herzog
db0d5952dd
Formatting 2019-05-13 12:35:14 +02:00
Christoph Herzog
ffe00b9fa3
Fix release tooling for juniper_codegen
Patch juniper_codegen dev dependency on juniper.
2019-05-12 21:31:15 +02:00
Christoph Herzog
de12e0eba5
Formatting... 2019-05-12 10:49:46 +02:00
Christoph Herzog
3cc142bfbc
Bump minimum rust version to 1.34 2019-05-12 10:49:40 +02:00
Christoph Herzog
52d7af2b8e
Remove internal macros from export + improve macro doc system.
Remove the internal macros from re-export.
This was a mistake.
Also, import each item from juniper_codegen manually to enable
rustdoc integration.
2019-05-12 10:36:30 +02:00
Christoph Herzog
a993c16b85
Deprecate graphql_object! and replace with impl_object
This commit deprecates the graphql_object macro and replaces
all of it's uses with the new impl_object proc macro.
(Except for the old macro tests).

This commit also adds new integration tests for impl_object.
2019-05-12 10:36:30 +02:00
Christian Legnitto
794568e463
Add release automation (#346)
See `RELEASING.md` for directions
2019-05-11 23:51:28 -07:00
Christian Legnitto
edd1b26d71
Fix CHANGELOG typos 2019-05-11 22:54:40 -07:00
Christoph Herzog
2e011014ea
Formatting... 2019-05-02 18:44:56 +02:00
Christoph Herzog
2ce2964b65
Fix clippy warnings 2019-05-02 18:44:56 +02:00
Christoph Herzog
5a4230e0d0
Remove macro_use + extern crate statements (2018 edition) 2019-05-02 18:44:56 +02:00
Christoph Herzog
54a1b64a79
Refactor code to 2018 edition with 'cargo fix --edition' 2019-05-02 18:44:56 +02:00
Christoph Herzog
178f594e58 Fix lookahead for optional arguments. 2019-05-02 18:30:27 +02:00
Christoph Herzog
85d5480d50 Make introspection tests ordering independent.
With the new HashMap implementation, the maps on stable and nightly
have different ordering.

The introspection tests were relying on strict ordering.
This commit adds a simple sorting of the results to prevent
test failures.
2019-05-02 18:25:14 +02:00
Christian Legnitto
6ff551fcb0 Support fragments with nested types in lookahead
Fixes https://github.com/graphql-rust/juniper/issues/335
2019-04-06 19:52:18 +02:00
Christian Legnitto
e11d0d2535 Remove typo in comment 2019-04-04 09:11:20 +02:00
Christian Legnitto
ba8cfbd105 Add support for the canonical introspection query
Fixes https://github.com/graphql-rust/juniper/issues/307.
2019-04-04 09:11:20 +02:00
Christoph Herzog
bd6f192998 Add Object::iter(_mut) return type change to changelog. 2019-03-08 23:06:00 +01:00
Christian Legnitto
287a24675a Fix TODO for return type
We have bumped past the point of this TODO so we can make
the changes.
2019-03-08 23:06:00 +01:00
Christian Legnitto
5241455d17 Remove deprecated function calls
The replacements were added in 1.30, which we have previously switched to
requiring. This silences two warnings.
2019-03-03 09:43:43 +01:00
Christian Legnitto
52fb87aaf4 Run cargo fmt on latest stable 2019-01-28 20:28:03 +01:00
Jakob Gillich
b4a0669b37 Add GraphQL Playground integration (#317) 2019-01-25 20:58:01 -08:00
Christian Legnitto
fa80bf7de7 Remove unused crate
This was throwing a warning during compiling.
2019-01-10 01:38:15 +01:00
theduke
c7d1481c6e Fix the literal value of DirectiveLocation::InlineFragment (#306)
The literal value according to the standard is INLINE_FRAGMENT,
not INLINE_SPREAD.

This oversight leads to invalid introspection schemas and trips up
third party tools.
2018-12-23 07:50:03 -08:00
Christoph Herzog
85ba97dcd9 Clean up introspection tests
* Prefix test function names with 'introspection'
* Use graphql_value! macro instead of manual construction
2018-12-23 15:33:47 +01:00
Christian Legnitto
88c17db8c3 Rename ScalarValue derive
Fixes https://github.com/graphql-rust/juniper/issues/299.
2018-12-19 20:17:17 +01:00
theduke
d015a3ca66 (ci) Check formatting with cargo fmt (#302)
This adds a new extra CI job for checking the formatting
with cargo fmt --check.
2018-12-19 10:27:49 -08:00
Christian Legnitto
aa80ec51bb Add integration tests to release automation
We want their version bumped when juniper is released as
well.
2018-12-19 07:25:27 -08:00
Christoph Herzog
2f5e3ab29b 0.11.1 Release
* Changelog
* Cargo.toml version bumps
2018-12-19 03:53:33 +01:00
Christoph Herzog
8dd2eafef8 Add *Internal custom derive variants for juniper crate
Currently, custom derives inside the main juniper crate are supported by
an ugly hack using the __juniper_use_everything macro.

This commit adds new custom derive variants that are for
main juniper crate internal use only (GraphQL{Enum,InputObject}Internal.

All custom derives inside the juniper crate are refactored to use the
new '*Internal' derives.

This allows us to
* remove the use_everything macro,
* simplify the generated code for custom derives
* support the Rust 2018 edition
2018-12-19 03:53:33 +01:00
Christoph Herzog
3f1ae66b2c Refactor macros to use $crate:: method instead of local_inner_macros.
This commit refactors the macros to use the $crate::inner_macro
trick instead of local_inner_macros.

This is possible since we only support rust 1.30 as a minimum version.
(the $crate:: method only works on 1.30+).

With this change, the wrapper helper macros for std macros can also
be removed.
2018-12-19 03:53:33 +01:00
Christian Legnitto
dee849c88b Bump min rust version to 1.30.0
Some dependiencies rely on cc, which after
228513449f
requires 1.30.0.
2018-12-18 23:17:43 +01:00
Christian Legnitto
81214dd5bf Fix typo 2018-12-17 15:15:56 -08:00
Christian Legnitto
9459435670 Update changelogs
Not sure why `cargo release` didn't do this...
2018-12-17 15:06:16 -08:00
Christian Legnitto
32c8979399 Tweak changelog rewriting 2018-12-17 15:01:31 -08:00
Christian Legnitto
f52c0e141e Don't use a dev version 2018-12-17 14:48:29 -08:00
Christian Legnitto
bcf2223e89 Automate updating versions in changelog
This is part of https://github.com/graphql-rust/juniper/issues/248
2018-12-17 14:04:46 -08:00
Christian Legnitto
905c73af78 Move juniper changelog to a single file in juniper crate 2018-12-17 14:04:46 -08:00
Christian Legnitto
2502c1b6da Set up some release automation.
Partially fixes https://github.com/graphql-rust/juniper/issues/248.

* Install `cargo-release`. (currently need a patched one with https://github.com/sunng87/cargo-release/pull/74)
* Run `cargo make release-dry-run` to do a dry run of a release
* Run `cargo make release` to do a minor versioned release of every crate
* Run `cargo make release-patch` to do a patch release of every crate

To only release one crate:
* Change directories into the desired crate
* Point `cargo-make` to the workspace-level Makefile when running a command. For example, `cargo make --makefile ../Makefile.toml release-dry-run`.

From the workspace root, run `cargo
2018-12-17 13:45:56 -08:00
Christian Legnitto
73175d7a10 Bump version 2018-12-17 13:11:21 -08:00
Christian Legnitto
7bb62ff259
Make rust 1.28 minimum supported version (#285) 2018-12-03 17:28:49 -08:00
Brendan Ball
e2212a539a Add method to scalar (#283) 2018-11-29 09:47:19 -08:00
Georg Semmler
4ecf558066 Use doc comments instead of the doc attribute in the changelog examples (#273) 2018-11-11 14:58:50 -08:00
Kevin Stenerson
0f2a654471 Infer graphql "deprecation" from #[deprecated(note = "...")] in derive (and macros) (#269)
* Update object/iface macro with doc/deprecated attrs for fields

* Use the note from `#[deprecated]` by default in derived GraphQLType

* Update to support multiline raw-docstring format

* Support bare deprecated attribute

* Update arguments to support #[doc] for parity with previous ` as ` syntax
2018-10-27 21:28:48 -06:00
Cole Graber-Mitchell
cf7e8df65f Make operation_name public (#265)
Fixes #253.
2018-10-23 06:09:39 -06:00
Georg Semmler
2e5df9f8a4 Introduce an abstraction for scalar values (#251)
Introduce an abstraction for scalar values

Before this change,  possible scalar values were hard coded to be representable
by one of the following types: `i32`, `f64`, `String` or `bool`. This
restricts the types of custom scalar values that can be defined. For
example, it was not possible to define a scalar value that represents an
`i64` without mapping it to a string (which would be inefficient).

One solution to fix the example above would simply be to change the
internal representation to allow it to represent an `i64`, but this would
only fix the problem for one type (until someone wants to support
`i128` for example). Also this would make juniper not follow the
GraphQL standard closely.

This commit takes another approach, by making the exact "internal"
representation of scalar values swappable (in such a way that a downstream crate could provide its own representation tailored to their needs). This allows juniper to provide a default type that only
contains the types described in the standard whereas other crates could define custom scalars for their needs.

To accomplish this we need to change several things in the current implementation:

* Add some traits that abstract the behavior of such a scalar value representation
* Change `Value` and `InputValue` to have a scalar variant (with a
  generic type) instead of hard coded variants for the standard
  types. This implies adding a generic parameter to both enums that
  needs to be added in the whole crate.
* Change the parser to allow deciding between different types of
  scalar values. The problem is basically that the original parser
  implementation had no way to know whether a parsed integer number is
  a `i32` or a `i64` (for example). To fix this we added some knowledge
  of the existing schema to the parser.
* Fix some macros and derives to follow the new behavior.

This commit also contains an unrelated change about the way `juniper_codegen`
resolves items from `juniper`. The `_internal` flag is removed and
the resolution is replaced by a macro.

The scalar parsing strategy is as follows:

* Pass optional type information all the way down in the parser. If a
  field/type/… does note exist, just do not pass down the type
  information.
* The lexer now distinguishes between several fundamental scalar types (`String`, `Float`, `Int`). It does not try to actually parse those values, instead it just annotates them that this is a floating point number, an integer number, or a string value, etc.
* If type information exists while parsing a scalar value, try the following:
    1. Try parsing the value using that type information.
    2. If that fails try parsing the value using the inferred type information from the lexer.
* If no type information exists, try parsing the scalar value using the inferred type from the lexer,

All macros support the introduced scalar value abstraction. It is now possible to specify if a certain implementation should be based on a specific scalar value representation or be generic about the exact representation. All macros now default to the `DefaultScalarValue` type provided by
`juniper` if no scalar value representation is specified. This is done with usability and backwards compatibility in mind.

Finally, we allow specifying the scalar value representations via an attribute
(`#[graphql(scalar = "Type")]`). A default generic implementation
is provided.
2018-10-22 21:40:14 -06:00
Christian Legnitto
bd455c9130
Remove Appveyor (#264)
Now that we have azure pipelines set up, there is no need
to use appveyor.

Part of https://github.com/graphql-rust/juniper/issues/259
2018-10-08 21:15:09 -07:00
Dylan DPC
95efe3821c Update uuid to 0.7 (#262) 2018-10-07 11:11:06 -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
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
Christian Legnitto
f2f68f868a
Add failure cases to http integration tests (#239) 2018-09-02 10:59:54 -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
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
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
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
Paul Colomiets
4dc155c51a Implement GraphQLType and ToInputValue for Arc<T> 2018-07-19 16:18:49 +02: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
Cameron Eldridge
e84167286b Handle an array of GraphQL queries (#171) 2018-06-07 17:44:30 -07:00
Kevin Stenerson
f2d228b8ae Add helpers to build custom GraphQLResponse (#158) 2018-05-29 23:28:36 -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
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
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
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
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
40c946c81c 0.9.2 release
* Changelogs
* Update versions and dependency versions
2018-01-13 10:34:30 +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
Josh Marlow
b1543f480a Fixed case where .unwrap was being called instead of the Option just being propagated up the call chain 2018-01-13 08:20:51 +00:00
Christian Legnitto
d34b6a85ad Fix some warnings 2018-01-13 07:48:39 +00:00
Christian Legnitto
203af1ce98 Support __typename for unions
See http://graphql.org/learn/queries/#meta-fields.

Fixes https://github.com/graphql-rust/juniper/issues/112.
2017-12-06 11:26:31 +01:00
theduke
ca9d5c1c1a Bump to 0.9.1 and fix up Cargo.toml files 2017-12-03 18:48:38 +01:00
theduke
0f916f4aa6 Remove ResultExt and jtry! macro 2017-12-03 18:33:35 +01:00
theduke
eb70d29e04 Fix readme link in juniper crate 2017-12-03 17:17:41 +01:00
theduke
ed58f2671b Final readme and cargo.toml fixups 2017-12-03 15:14:23 +01:00
theduke
4d6a99fe4e Fix up Cargo.toml files and documentation. 2017-12-02 18:33:20 +01:00
theduke
0024e67dae Move enum introspection tests to executor_tests 2017-12-02 15:46:11 +01:00
theduke
0e3c9940c6 Exchange graphql_input_object! macro to custom derive
* Refactor all internal use to derive
* Remove macro
* Move tests to executor_tests
2017-12-02 15:43:41 +01:00
theduke
f858f416b8 Remove graphql_enum! macro in favor of custom derive
* Extend derive for enums to allow deriving inside the juniper crate
  itself. Note: this is a rather ugly hack right now, FIXME is in the
  code
* Remove the graphql_enum! macro and replace all internal use with
  derive
* Refactor introspection tests to use derive
2017-12-02 15:43:22 +01:00
theduke
709231dc46 Make juniper_codegen dependency non-optional. 2017-12-02 03:55:14 +01:00
theduke
40d8f905e9 Move executor.rs in subfolder
Preparation for splitting up executor.rs
2017-12-02 03:51:28 +01:00
theduke
f3626c57c6 Move to_camel_case helper to util module. 2017-12-02 03:36:07 +01:00
theduke
3750349e71 Bump version to 0.9.0 2017-12-02 02:31:56 +01:00
theduke
141292ad91 Export codegen from main juniper crate
Use a trick for re-exporting proc-macros to supply juniper_derive as a
dependency of juniper.

Users will now just have to depend on juniper directly.
2017-12-02 02:27:41 +01:00
Magnus Hallin
c4ded5781d Fix bug where non-null lists could contain null if errors were returned 2017-11-20 08:53:51 +01:00
Magnus Hallin
23105259de Add another test for null handling in lists 2017-11-20 08:53:32 +01:00
Magnus Hallin
d0e9202f41 Add tracking of the current type being resolved in the Executor
This is not 100% accurate - it will be set to the literal type of what
a field returns, so it might be wrapped in non-null/list when it
technically shouldn't.

For this use-case it's fine, but if we want to (officially) add it to
the public API surface, we should probably make it accurate.
2017-11-20 08:53:13 +01:00
Jacob Haslehurst
8cf2707faa add failing test for list of non-null items for issue #84 2017-11-20 11:44:11 +11:00
Magnus Hallin
dca88b0fa4 Don't use global variable in test 2017-11-18 18:33:57 +01:00
Magnus Hallin
7b695c406c Propagate errors to closest nullable parent field
This also fixes a bug where context switching on optional values did
not properly work.
2017-11-18 18:19:11 +01:00
Cameron Eldridge
625bac1b62 Add support for Z time zone and fractional seconds in date formats (#97)
* Add support for Z time zone and fractional seconds in date formats and reduce repitition in tests
2017-11-01 16:59:06 +01:00
thomas-jeepe
6d345b6b98 Serialize on GraphQLRequest
What the title says
2017-10-30 16:24:47 +01:00
thomas-jeepe
76a1a042aa Derive Clone for GraphQLRequest
This is just a useful thing for me because I need to clone the http request.

This shouldn't really influence anything else, every field already implements `Clone`
2017-10-29 09:12:56 +01:00
Jacob Haslehurst
62d5e28a97 Give DateTime scalars valid names to pass validation 2017-10-20 18:57:48 +02:00
Jane Keibler
650561f885 Removing configuration that rust nightly
The feature function causes the following error:
error[E0554]: #![feature] may not be used on the stable release channel
2017-10-20 18:35:42 +02:00
Sam Rijs
74c5f562e3 Merge branch 'master' into perf/schema-fnv-hash-map 2017-10-02 19:43:49 +11:00
Sam Rijs
bcb594edc1 perf(schema): use FnvHashMap for type and directive names 2017-10-02 19:07:09 +11:00
Christian Legnitto
2a2534525d chrono feature: Implement GraphQLType for chrono types
Fixes https://github.com/graphql-rust/juniper/issues/87
2017-09-30 08:21:42 +02:00
theduke
f9d6f2c83f Revert "(juniper) Clean up uuid and url features."
This reverts commit dcdc03a9b9.
2017-09-12 11:01:56 +02:00
theduke
dcdc03a9b9 (juniper) Clean up uuid and url features.
* Do not enable uuid/url feature by default
* CI: customize juniper Makefile to test with all features
2017-09-11 23:26:32 +02:00
Christian Legnitto
c1cb120176 url feature: Implement url::Url as a scalar type 2017-09-11 16:10:54 +02:00
rushmorem
f7625056ac Expose executor.location(), rename executor.push_error() to
`executor.push_error_at()` and add a new `executor.push_error()`
2017-09-02 13:35:57 +02:00
Magnus Hallin
b3ea59cd3b Merge pull request #80 from graphql-rust/field-error-refactor
Field error refactor
2017-09-02 10:44:50 +02:00
Christian Legnitto
5d43532d73 Preserve the order of requested fields
Fixes https://github.com/graphql-rust/juniper/issues/82
2017-09-02 10:40:04 +02:00
theduke
0372de84d5 Rename ToInputValue::to to to_input_value() 2017-08-29 05:34:35 +02:00
theduke
164aa29fdc Rename FromInputValue::from() to from_input_value() 2017-08-29 05:34:35 +02:00