Commit graph

946 commits

Author SHA1 Message Date
Christian Legnitto
892619a35b
Fix typos in dataloader docs 2020-04-25 20:26:16 -10:00
Christian Legnitto
9e554981ee
Add actix to readme 2020-04-21 07:31:35 -10:00
Jordão Rodrigues Oliveira Rosario
a47d1c5430
Add actix-web integration (#603) 2020-04-20 20:21:02 -10:00
André Isaksson Kraft
2ba9f71b0c
Make graphql_scalar a proc macro (#610)
Fixes #571

Signed-off-by: andrisak <andrisak@gmail.com>

* Replaced the old macro with the new proc macro.
Updated documentation.

Signed-off-by: andrisak <andrisak@gmail.com>

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-20 10:15:09 -10:00
Jonas Meurer
fe99e1cc70
Allow specifying scalar and context for GraphQLEnum (#621)
* Updated implementation of derive enum

- allows context specification
- allows scalar specification
- shares code with derive object

* Added this feature to CHANGELOG

* Added matrix with supported macro attributes for enums

* Added case which checks for custom context

* GraphQLUnion now can use a different context per variant

* Moved context switch test for union into right folder

* Sync resolve expression has the same form as the other impls

* Disabled custom scalar on GraphQLEnum

* Fixed CHANGELOG

* Fixed support matrix of GraphQLEnum in the book

- scalar not supported!
- skip not supported!

* Added test case for "noasync" derive attribute

* Disallowed generics and lifetimes on GraphQLEnum

* Added error message for duplicate naming

* Added error message for empty variant
2020-04-17 19:09:04 -10:00
Jordão Rodrigues Oliveira Rosario
7e8724751f
Initial implementation of Subscription Docs (#609)
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-16 20:16:00 -10:00
Jonas Meurer
a05f4e55c4
Derive macro for tagged enums (GraphQLUnion) (#618)
* Implemented device macro for GraphQLUnion's

* Updated PR link in CHNAGELOG

* Disabled documentation on enumeration fields

* Disabled skip on fields

* Changed implementation for std::convert::Into since skip is not possible

* Added documentation for GraphQLUnion

* Added tests for GraphQLUnion

* Fixed typos in error messages (as suggested by review)

* Fixed failing documentation example

* Utilized `resolver_code` in `util::GraphQLTypeDefinitionField`.

Simplifies code and provides the idea of using
`util::GraphQLTypeDefinitionField` for different types than objects.

* Removed wrong statement about skip annotation in docs.

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-14 21:58:45 -10:00
Matthew Kuo
47f7ffaa5b
Add subscriptions support for GraphiQL (#619)
* Add subscriptions support on GraphiQL

Addresses #501

BREAKING CHANGE: `juniper::http::graphiql::graphiql_source` now requires
a second parameter

BREAKING CHANGE: `juniper_hyper::graphiql` now requires
a second parameter

BREAKING CHANGE: `juniper_iron::GraphiQLHandler::new` now requires
a second parameter

BREAKING CHANGE: `juniper_rocket::graphiql_source` now requires
a second parameter

BREAKING CHANGE: `juniper_warp::graphiql_filter` now requires
a second parameter

* Add test where graphiql subscriptions endpoint is not None
2020-04-12 15:03:09 -10:00
Christian Legnitto
f0ccc2e35e
Compile and test juniper_hyper on stable (#616)
This file was put in place to work around a bug. The fix has now
made it to stable.
2020-04-10 00:16:03 -10:00
Christian Legnitto
5f454e05c7
Move graphiql export location (#615)
This fixes a TODO.
2020-04-10 00:06:39 -10:00
Christian Legnitto
2618100140
Update juniper_rocket to central GraphQLBatch* enums (#614) 2020-04-09 23:24:33 -10:00
Christian Legnitto
6b040c509b
Update juniper_hyper to central GraphQLBatch* enums (#613) 2020-04-09 22:45:34 -10:00
Christian Legnitto
c09be69b7d
Update rocket_async to central GraphQLBatch* enums (#612) 2020-04-09 22:10:24 -10:00
Christian Legnitto
33c3526931
Update iron to central GraphQLBatch* enums (#611) 2020-04-09 21:28:36 -10:00
Jordão Rodrigues Oliveira Rosario
926d4e5738
Changed implementation location for GraphQLBatchRequest/Response (#608) 2020-04-09 19:35:30 -10:00
Jairo H Wiethan
c12f40c0f5
Removed 'compat' feature from futures on juniper_subscriptions and juniper_warp (#606) 2020-04-08 15:40:22 -10:00
Jordão Rodrigues Oliveira Rosario
1412561ffd
Added document validation in the resolve_into_stream method and a test (#604) 2020-04-05 11:59:10 -10:00
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
nWacky
dbe2c67cb8
Minor improvements to subscriptions functionality (#591)
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-03-30 20:43:00 -07:00
Sagie Gur-Ari
c91b989e2d
Use github action to download cargo-make (#594) 2020-03-30 20:03:44 -07:00
Samuel Hurel
6e4bc127b0
Add support for bson::UtcDateTime (#585) 2020-03-24 17:21:05 -07:00
imspace
3b465cbf04
Fix websocket connection in warp subscriptions example (#583) 2020-03-24 17:20:34 -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
Yusuke Sasaki
a275c8dcc2
doc: remove outdated examples from third-party integrations list (#572) 2020-03-18 20:46:32 -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
samuela
1411969c37
err.description is deprecated (#537) 2020-03-09 00:12:57 -07:00
Christian Legnitto
51b86af13b
Update images for azure pipelines (#555)
There were warnings saying later this month these images were going away. Switch to supported images from https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
2020-03-09 00:12:11 -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
Félix Gagnon-Grenier
15e9bffa84
Warning about normal methods (#545)
There's a comment [here](https://docs.rs/juniper/0.14.2/juniper/attr.object.html) that only GraphQL fields can be specified in `#[juniper::object]` impl block, yet in the book it was not specified, I needed help to get the idea to try it.

I simply copied that information because it feels important.

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-03-04 08:58:52 -08:00
Victor-Nicolae Savu
f5e4b6b9b6
Match the list of integrations to the page order (#548)
* Remove duplicate link to Hyper integration

The `Adding a Server` page contains a duplicate link to `Hyper`. The first of them can cause the reader to accidentally skip the `Rocket` and `Iron` integration pages because their pages are before the one for `Hyper` in the reading order. 

Remove the first link so that the list of official server integrations matches the page order.

* Match the list of integrations to the page order

In the book, the pages for the official integrations appear in the order: `Warp`, `Rocket`, `Iron`, `Hyper`, but on the `Official Server Integrations` page they are listed with `Hyper` first. This can cause readers to accidentally skip the other three integrations if they click on the link for `Hyper` first. 

Move `Hyper` to the bottom of the list to match the reading order of the book.

* Remove unnecessary blank line
2020-03-02 09:57:17 +01:00
Justin Lee
a0b854f31c
Update README.md (#535)
Improved wording
2020-02-20 23:22:40 -07:00
Christian Legnitto
8925f64983
Temporarily disable interface tests (#543)
These aren't reimplemented yet as proc macros. Disabling them
so book tests on PRs pass and the website is updated.
2020-02-20 23:21:41 -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
samuela
db68dd7697
Extern crates are no longer necessary (#536) 2020-02-20 22:28:27 -07:00
Christian Legnitto
b63a44e0f8
Add futures dependency (#541)
Fixes https://github.com/graphql-rust/juniper/issues/534.

I am not sure if the best way is to have folks bring their own futures for the
derives / macros or to pull it in as a dep explicitly like I have done here.

Because people are filing issues, we will do it this way and see what other issues arise.
2020-02-20 21:53:39 -07:00
nickelc
547cf3e36f
Add GitHub workflows for CI and Book (#487) 2020-02-12 23:55:45 -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