Commit graph

144 commits

Author SHA1 Message Date
Mihai Dinculescu
45c16acc6e
Actix subscriptions tests (#736)
* Actix subscriptions tests

* Use LocalBoxFuture instead of async-trait

* expose-test-schema already includes serde_json

* Add anyhow to juniper dev-dependencies

* The HTTP test helpers are not needed for juniper tests

* juniper_actix does not need tokio in dev-dependencies

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-08-18 21:08:53 -10:00
Christian Legnitto
29930b002b
Update compile fail tests for nightly Rust (#710)
* Update compile fail tests for latest Rust

The messages appear to have changed on nightly

* Fix tests depending on fixture data

* Fix more integration test paths

* Fix doc warnings
2020-07-18 13:19:50 -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
Kai Ren
4d77a1a9b9
Strip redundant Send/Sync bounds (#688)
Additionally:
- strip redundant type parameters for juniper::Context in some core definitions and reuse associated type
2020-06-30 18:13:15 +03: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
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
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
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
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
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
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
Oleksandr
dea15f489d
Disable default features for rocket integration (#530) 2020-02-12 23:43:05 -07:00
Christian Legnitto
211737cee0 Format code 2020-01-29 07:51:35 -05:00
Christian Legnitto
c8bec0fba3 Fix test 2020-01-29 07:51:35 -05:00
Christian Legnitto
b9193ddb61 Remove deprecated function 2020-01-29 07:51:35 -05:00
Christian Legnitto
036b72796a Only run async tests on master for crates that require master 2020-01-21 09:22:14 -08:00
Christian Legnitto
9a634bb8e2 Add fake features to integration crates 2020-01-21 08:17:49 -08:00
Christian Legnitto
0542c3aeac Release juniper_rocket 0.5.2 2020-01-18 17:14:35 -08:00
Christian Legnitto
73dc5cd5b8 Release juniper 0.14.2 2020-01-18 17:14:35 -08:00
Christoph Herzog
5d270b7dea Formatting 2019-11-15 22:18:38 +01:00
Christoph Herzog
50605ee73e Duplicate juniper_rocket for async
This is required because rocket only supports futures on a git branch.
2019-11-15 21:52:22 +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
a5580a939d Update most crates to futures 0.3, add todos on not updated crates 2019-11-12 12:04:09 +00:00
Christian Legnitto
c298697619
Release juniper_rocket 0.5.1 2019-11-05 11:14:17 +03:00
Christian Legnitto
191468bf04
Release juniper 0.14.1 2019-11-05 11:14:16 +03: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
Kai Ren
8d33e8db12 Upgrade futures-preview, tokio crates and remove unnecessary 'async_await' feature (#436) 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
47e7003a7b Fix the rest of the rocket stuff 2019-10-09 22:22:13 -07:00
Graeme Coupar
1e348ea1bd Update for latest rust nightly 2019-10-09 22:22:13 -07:00
Graeme Coupar
65a641c7d6 Some more updates to juniper_rocket 2019-10-09 22:22:13 -07:00
Graeme Coupar
8033deba12 Update to support async branch of rocket. 2019-10-09 22:22:13 -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
2afec7f433 Release juniper_rocket 0.5.0 2019-09-29 19:09:06 -07:00
Christian Legnitto
dbbceae643 Release juniper 0.14.0 2019-09-29 19:04:31 -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
66cab53345 Fix the rest of the rocket stuff 2019-08-21 16:47:47 +01:00
Graeme Coupar
6c54f05efb Update for latest rust nightly 2019-08-21 16:34:57 +01:00
Graeme Coupar
1d7ee1bcb1 Some more updates to juniper_rocket 2019-08-21 16:34:57 +01:00
Graeme Coupar
bb582e998c Update to support async branch of rocket. 2019-08-21 16:34:49 +01: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
9909b2dc1b Release juniper_rocket 0.4.1 2019-07-29 08:11:42 -07:00
Christian Legnitto
48c26a26b3 Release juniper 0.13.1 2019-07-29 08:08:05 -07:00
Christian Legnitto
60ba06f846 Release juniper_rocket 0.4.0 2019-07-19 14:01:21 -07:00
Christian Legnitto
54f98f46db Release juniper 0.13.0 2019-07-19 14:01:21 -07:00
Andrey Kutejko
5b9a0bd31b Split Query and Database types in example schema (#360) 2019-05-18 09:07:51 -07:00
Christian Legnitto
81a2c2bd90 Release juniper_rocket 0.3.0 2019-05-16 19:11:10 -07:00
Christian Legnitto
9c9e3da72d Release juniper 0.12.0 2019-05-16 19:03:21 -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
Christian Legnitto
794568e463
Add release automation (#346)
See `RELEASING.md` for directions
2019-05-11 23:51:28 -07: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
Jakob Gillich
b4a0669b37 Add GraphQL Playground integration (#317) 2019-01-25 20:58:01 -08: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
9459435670 Update changelogs
Not sure why `cargo release` didn't do this...
2018-12-17 15:06:16 -08:00
Christian Legnitto
73175d7a10 Bump version 2018-12-17 13:11:21 -08:00
Christoph Herzog
e2063bd932 Bump juniper_rocket to 0.2 2018-12-16 11:23:07 +01:00
Chris Schneider
733125c60b Fix example link in juniper_rocket README (#291)
The official repo was combined back into the main juniper repo, but the link didn't get updated.
2018-12-11 19:58:25 -07: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
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
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
Marshall Bowers
facb0d2f5d [juniper_rocket] Expose GraphQLResponse fields (#238) 2018-08-31 18:46:27 -07:00
Christoph Herzog
56f71e934b Format code 2018-07-19 16:18:49 +02:00
Sharad Chand
569bc16415 Don't make assumptions what features the rocket app might use. (#204) 2018-07-06 08:10:08 -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
Christoph Herzog
3df18f41f8 (juniper_rocket) Bump minimum rocket version to 0.3.9
Needed to bump minimum version to allow working on latest nightly.
2018-05-03 01:19:52 +02:00
Sackery
10538eca8b Change pretty json string to compact json string 2018-02-08 21:05:00 +01:00
Christoph Herzog
d00e74bb4e Format entire codebase with rustfmt 2018-01-13 12:25:55 +01:00
Christoph Herzog
40c946c81c 0.9.2 release
* Changelogs
* Update versions and dependency versions
2018-01-13 10:34:30 +01:00
Christoph Herzog
5670fc7eb1 add decode query params to 0.1.2 changelog. 2018-01-13 10:02:43 +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
Christoph Herzog
883dd0b2ee juniper_rocket 0.1.2 release
* Bump version
* fix up changelog
2018-01-13 09:42:01 +01:00
sagie gur ari
23cf596748 windows build 2018-01-13 08:36:08 +00:00
Christian Legnitto
5b439f3fc1 Add a master changelog
This makes it so people using git dependencies know what has changed. It also
gives a spot to make a running changelog so when we do a release we can just
copy and paste.
2018-01-13 08:22:23 +00:00
Christian Legnitto
ff01738a60 Update rocket in juniper_rocket to work with latest nightlies
`juniper_rocket` now requires nightly >= 2018-01-12. See
https://github.com/SergioBenitez/Rocket/issues/513#issuecomment-357407524.

Fixes https://github.com/graphql-rust/juniper/issues/125.
2018-01-13 07:50:33 +00:00
Christian Legnitto
5c3fb8e913 Update Rocket to latest version
Rocket requires nightly, but on nightly 2017-12-13 and after
the version of Rocket juniper's integration was using wouldn't
build. This is solved by updating Rocket to `0.3.4` which
according to the [changelog](https://github.com/SergioBenitez/Rocket/blob/v0.3.4/CHANGELOG.md#version-034-dec-14-2017):

"Codegen was updated for 2017-12-13 nightly."
2017-12-22 09:06:34 +01:00
theduke
ca9d5c1c1a Bump to 0.9.1 and fix up Cargo.toml files 2017-12-03 18:48:38 +01:00
theduke
ed58f2671b Final readme and cargo.toml fixups 2017-12-03 15:14:23 +01:00
theduke
e37b7cc77d Fix repository links in iron/rocket Cargo.toml 2017-12-03 13:12:45 +01:00
Sagie Gur-Ari
9e424a8630 v09 build fix for windows (#115)
Fix cargo make makefiles for only running the juniper_rocket build on nightly.
2017-12-03 10:31:56 +01:00
theduke
00e80bbe88 (tests) Only build juniper_rocket on nightly 2017-12-03 00:40:49 +01:00
theduke
4d6a99fe4e Fix up Cargo.toml files and documentation. 2017-12-02 18:33:20 +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