Commit graph

961 commits

Author SHA1 Message Date
Teymour Aldridge
31d08888e4
Make some comments clearer. (#665) 2020-05-23 20:29:58 -10:00
Caio
2cb96d0fc4
impl GraphQLScalar for NaiveTime (#657)
* impl GraphQLScalar for NaiveTime

* Add feature
2020-05-20 22:13:31 -10:00
Caio
0bb1c5beac
Relax Default impl constraint (#664)
* Relax Default impl constraint

For EmptyMutation and EmptySubscription. The built-in derive
expects `T: Default`, which is not necessary for a PhantomData
wrapper.

* Add test
2020-05-19 05:46:56 -10:00
bumblepie
5021ae80e1
Improve lookahead visibility for aliased fields (#662)
* Improve lookahead visibility for aliased fields
- Add a method to access the children of look ahead structs
- Make the behaviour around accessing aliased lookahead fields more consistent

* Deprecate old Lookahead methods for accessing child selections
2020-05-16 21:43:37 -10:00
Julio Daniel Reyes
91a3353983
Update dataloader explanation code (#661) 2020-05-13 16:37:14 -10:00
Kai Ren
aedb2d1eb4
Support "Content-Type: application/graphql" (#426) (#654)
* Support 'application/graphql' POST requests for 'juniper_warp'

* Add integration tests for 'application/graphql' POST requests and revive HttpIntegration test suite for 'juniper_warp'

* Support 'application/graphql' POST requests for 'juniper_hyper' and run its tests for both sync and async versions

* Run integration tests for both sync and async versions of 'juniper_warp' and update its CHANGELOG

* Support 'application/graphql' POST requests for 'juniper_iron'

* Fix 'application/graphql' POST requests support for 'juniper_actix'

* Support 'application/graphql' POST requests in 'juniper_rocket' and 'juniper_rocket_async'

* Upd juniper's CHANGELOG
2020-05-08 06:00:49 -10:00
Mihai Dinculescu
d13305f202
Exclude basic subscriptions example from workspace (#648) 2020-05-02 15:31:32 -10:00
Jonas Meurer
558eae91df
Ensure Specification(June 2018) Compliance (#631)
* Implemented most test cases from the specification

* Unified error handling for all generators

- Removed proc-macro-error -> not required -> use syn::Error
- Everything below lib.rs uses proc_macro2::TokenStream
  instead of proc_macro::TokenStream
- Replaced error handling in attribute parsers

* WIP better error messages for *all* macros

* Refactored GraphQLInputObject and minor tweaks

- removed support for Scalar within a string ("DefaultScalarValue")
- removed unraw function and replaced it with the built-in one
- added error messages and return types for all functions within utils
- added more constraints to fulfill the GraphQL spec

* Fixed test-cases which are not compliant with the specification

* Removed unused function

* Added constrains, updated error messages, added marker

* Added argument rename within impl_graphql and fixed `__` tests

* Formatted and cleanup

* Added GraphQLTypeAsync for input object

* Moved codegen tests to separate module

Nightly and stable produce different outputs, thus only test nightly.

* Added IsInputType/IsOutputType traits for type checking

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-05-01 16:24:01 -10:00
Christian Legnitto
358ca27d28
Fix panic with invalid unicode query (#645)
Without this fix the panic looks like the following:

```rust
---- parser::tests::lexer::string_errors stdout ----
thread 'parser::tests::lexer::string_errors' panicked at 'byte index 4 is not a char boundary; it is inside 'ɠ' (bytes 3..5) of `"\uɠ^A`', src/libcore/str/mod.rs:2219:5
```

This was found via fuzzing with `cargo-fuzz`.
2020-04-30 16:08:23 -10:00
Kai Ren
52aea4d68d
Disallow deserialize empty GraphQLBatchRequest (#639) (#644)
* Disallow deserialize empty GraphQLBatchRequest (#639)

* Add test for empty batch request
2020-04-30 06:16:15 -10:00
Jonas Meurer
845331033e
Documented Alternative Error Handling (#634)
* Added alternative error handling

* Fixed book tests and some sentences

* Apply suggestions from code review

Co-Authored-By: Christian Legnitto <LegNeato@users.noreply.github.com>

* Fixed book examples

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-04-28 06:41:19 -10:00
Kai Ren
79c265f027
Remove direct usage of 'serde_derive' crate and redundant usage of 'serde' crate (#640) 2020-04-28 06:39:35 -10:00
Byeongjee Kang
c761d91c69
Fix a minor typo in comment (#637) 2020-04-27 18:09:00 -10:00
Kai Ren
9064d7f523
Avoid unnecessary Vec allocation when executing GraphQLBatchRequest (#638)
Additionally:
- make GraphQLBatchRequest/GraphQLBatchResponse code a bit more laconic
2020-04-27 18:08:27 -10:00
Byeongjee Kang
dc4cdf0bf5
Fix deprecated comments (#635)
build_*_type methods return meta types directly.
They don't return builders.
2020-04-26 20:28:05 -10:00
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