Commit graph

15 commits

Author SHA1 Message Date
Kai Ren
cbf16c5a33
Make interfaces great again! (#682)
* Bootstrap

* Upd

* Bootstrap macro

* Revert stuff

* Correct PoC to compile

* Bootstrap #[graphql_interface] expansion

* Bootstrap #[graphql_interface] meta parsing

* Bootstrap #[graphql_interface] very basic code generation [skip ci]

* Upd trait code generation and fix keywords usage [skip ci]

* Expand trait impls [skip ci]

* Tune up objects [skip ci]

* Finally! Complies at least... [skip ci]

* Parse meta for fields and its arguments [skip ci]

- also, refactor and bikeshed new macros code

* Impl filling fields meta and bootstrap field resolution [skip ci]

* Poking with fields resolution [skip ci]

* Solve Rust's teen async HRTB problems [skip ci]

* Start parsing trait methods [skip ci]

* Finish parsing fields from trait methods [skip ci]

* Autodetect trait asyncness and allow to specify it [skip ci]

* Allow to autogenerate trait object alias via attribute

* Support generics in trait definition and asyncify them correctly

* Temporary disable explicit async

* Cover arguments and custom names/descriptions in tests

* Re-enable tests with explicit async and fix the codegen to satisfy it

* Check implementers are registered in schema and vice versa

* Check argument camelCases

* Test argument defaults, and allow Into coercions for them

* Re-enable markers

* Re-enable markers and relax Sized requirement on IsInputType/IsOutputType marker traits

* Revert 'juniper_actix' fmt

* Fix missing marks for object

* Fix subscriptions marks

* Deduce result type correctly via traits

* Final fixes

* Fmt

* Restore marks checking

* Support custom ScalarValue

* Cover deprecations with tests

* Impl dowcasting via methods

* Impl dowcasting via external functions

* Support custom context, vol. 1

* Support custom context, vol. 2

* Cover fallible field with test

* Impl explicit generic ScalarValue, vol.1

* Impl explicit generic ScalarValue, vol.2

* Allow passing executor into methods

* Generating enum, vol.1

* Generating enum, vol.2

* Generating enum, vol.3

* Generating enum, vol.3

* Generating enum, vol.4

* Generating enum, vol.5

* Generating enum, vol.6

* Generating enum, vol.7

* Generating enum, vol.8

* Refactor juniper stuff

* Fix juniper tests, vol.1

* Fix juniper tests, vol.2

* Polish 'juniper' crate changes, vol.1

* Polish 'juniper' crate changes, vol.2

* Remove redundant stuf

* Polishing 'juniper_codegen', vol.1

* Polishing 'juniper_codegen', vol.2

* Polishing 'juniper_codegen', vol.3

* Polishing 'juniper_codegen', vol.4

* Polishing 'juniper_codegen', vol.5

* Polishing 'juniper_codegen', vol.6

* Polishing 'juniper_codegen', vol.7

* Polishing 'juniper_codegen', vol.8

* Polishing 'juniper_codegen', vol.9

* Fix other crates tests and make Clippy happier

* Fix examples

* Add codegen failure tests, vol. 1

* Add codegen failure tests, vol. 2

* Add codegen failure tests, vol.3

* Fix codegen failure tests accordingly to latest nightly Rust

* Fix codegen when interface has no implementers

* Fix warnings in book tests

* Describing new interfaces in Book, vol.1

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-10-05 21:21:01 -10:00
Christian Legnitto
3c79f6a2c5
Move starwars schema into fixture directory (#694)
Move starwars query into fixture directory

Also include the graphql schema definition file and a test
to make sure they match.
2020-07-15 21:46:37 -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
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
Christian Legnitto
e9b8aa2c38
Rename execute -> execute_sync, execute_async -> execute (#556) 2020-03-09 22:40:26 -07: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
Andrey Kutejko
5b9a0bd31b Split Query and Database types in example schema (#360) 2019-05-18 09:07:51 -07:00
Christoph Herzog
5a4230e0d0
Remove macro_use + extern crate statements (2018 edition) 2019-05-02 18:44:56 +02: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
Eric Dattore
cb00a7b2bc Update juniper_rocket for Rocket 0.4 (#277)
Path handling changed in Rocket 0.4 and this commit updates the way
those paths are handled. It adds an implementation of the
`FromFormValue` trait to the `GraphQLRequest` object. It also changes
the documentation to use the multi-segment query string syntax.

All existing tests pass as expected.
2018-12-10 17:45:22 -07:00
Christoph Herzog
d00e74bb4e Format entire codebase with rustfmt 2018-01-13 12:25:55 +01:00
theduke
b89712a887 Add juniper_rocket back to main repo
This is done for a lower maintainance burden and combined testing.
2017-12-02 15:59:23 +01:00
theduke
2ca9baa441 Extracted iron/rocket crates and updated README.
Those now live in separate repos.
2017-08-07 08:20:05 +02:00
theduke
0c7e39f14e Rust fmt the whole codebase 2017-08-06 21:15:08 +02:00
theduke
619a2e57f9 Extraction of iron and rocket features into separate crates.
* Added juniper_iron crate
* Fixed up juniper_rocket crate
* Updated juniper/Cargo.toml
* Updated docs (readme, module docs)
* Export http integrator tests with export-test-schema feature
* Update CI tests (Use cargo-make )
* Format parts of the code base
2017-08-06 17:42:31 +02:00