Commit graph

94 commits

Author SHA1 Message Date
samuela
db68dd7697
Extern crates are no longer necessary (#536) 2020-02-20 22:28:27 -07:00
Genna Wingert
4ccb129fa2
Update juniper_hyper to hyper 0.13 and add async resolution (#505)
This involves updating to futures 0.3, tokio 0.2 stable
2020-02-12 23:48:28 -07: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
9d3cfc1c59 Release juniper_hyper 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
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
09d9513da9
Rebase onto master 2019-11-06 11:45:19 +03:00
Christian Legnitto
03fca018a6 Release juniper_hyper 0.5.0 2019-09-29 19:05:37 -07:00
Christian Legnitto
dbbceae643 Release juniper 0.14.0 2019-09-29 19:04:31 -07:00
Christian Legnitto
02fd164e96
Update url dependency (#432) 2019-09-29 18:47:37 -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
Christian Legnitto
554b3633cf Release juniper_hyper 0.4.1 2019-07-29 08:09:14 -07:00
Christian Legnitto
48c26a26b3 Release juniper 0.13.1 2019-07-29 08:08:05 -07:00
Christian Legnitto
6d7c72dda6 Release juniper_hyper 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
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
Kai Ren
49f723a3dd Optimize .unwrap_or() and .expect() usages (#374) 2019-06-18 23:12:13 -04:00
Andrey Kutejko
5b9a0bd31b Split Query and Database types in example schema (#360) 2019-05-18 09:07:51 -07:00
Christian Legnitto
d1b5c1bb4d Release juniper_hyper 0.3.0 2019-05-16 19:05:32 -07:00
Christian Legnitto
9c9e3da72d Release juniper 0.12.0 2019-05-16 19:03:21 -07:00
Christoph Herzog
50a5f2a258 (ci) Re-enable juniper_hyper testing on nightly. 2019-05-16 23:38:54 +02: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
Christoph Herzog
6562440105 Disable juniper_hyper testing due to rustc bug. 2019-03-06 23:36:21 +01: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
373e5fa5c8 Update juniper_hyper's changelog 2018-12-18 11:18:45 -08:00
Christian Legnitto
f3d0308425 Remove extra release.toml 2018-12-18 11:12:25 -08:00
Christian Legnitto
632c941e4a Rename changelog to match other crates 2018-12-18 11:11:18 -08:00
Christian Legnitto
1868acc5a1 Bump versions past current crates.io version 2018-12-17 14:04:40 -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
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
f3940df6d5
Add changelog entry for https://github.com/graphql-rust/juniper/pull/256 2018-09-30 11:18:21 -07:00
Jon Gjengset
ec963a6e71 Use only a single thread pool for juniper_hyper (#256)
The previous implementation used a futures_cpupool for executing
blocking juniper operations. This pool comes in addition to the
thread pool started by hyper through tokio for executing hyper's futures.
This patch uses tokio::blocking to perform the blocking juniper
operations while re-using the same thread pool as hyper, which
simplifies the API.
2018-09-30 11:07:44 -07:00
Christian Legnitto
be4c352939
Use the crates.io version of reqwest (#247)
This allows us to publish `juniper_hyper`
2018-09-13 10:06:03 -07:00
Christian Legnitto
e82abede94
Fix up licenses for warp and hyper integrations (#246) 2018-09-13 09:32:21 -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
Damir Vandic
fc10b5e8f5 Update readme with link to hyper and fix link to example server (#240) 2018-09-02 10:29:47 -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