Commit graph

145 commits

Author SHA1 Message Date
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