Commit graph

470 commits

Author SHA1 Message Date
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
aa80ec51bb Add integration tests to release automation
We want their version bumped when juniper is released as
well.
2018-12-19 07:25:27 -08:00
Christoph Herzog
d43d5f2c2d Fix cargo make config for 2018 edition test crate 2018-12-19 12:46:37 +01:00
Christoph Herzog
f02e427cab Refactor integration test layout + add minimal 2018 edition test
* Add a new integration_tests subdirectory that holds integration tests
* Add a new, temporary (and really minimal) 2018 edition test crate
2018-12-19 03:53:33 +01:00
Christoph Herzog
2f5e3ab29b 0.11.1 Release
* Changelog
* Cargo.toml version bumps
2018-12-19 03:53:33 +01:00
Christoph Herzog
8dd2eafef8 Add *Internal custom derive variants for juniper crate
Currently, custom derives inside the main juniper crate are supported by
an ugly hack using the __juniper_use_everything macro.

This commit adds new custom derive variants that are for
main juniper crate internal use only (GraphQL{Enum,InputObject}Internal.

All custom derives inside the juniper crate are refactored to use the
new '*Internal' derives.

This allows us to
* remove the use_everything macro,
* simplify the generated code for custom derives
* support the Rust 2018 edition
2018-12-19 03:53:33 +01:00
Christoph Herzog
3f1ae66b2c Refactor macros to use $crate:: method instead of local_inner_macros.
This commit refactors the macros to use the $crate::inner_macro
trick instead of local_inner_macros.

This is possible since we only support rust 1.30 as a minimum version.
(the $crate:: method only works on 1.30+).

With this change, the wrapper helper macros for std macros can also
be removed.
2018-12-19 03:53:33 +01:00
Christian Legnitto
dee849c88b Bump min rust version to 1.30.0
Some dependiencies rely on cc, which after
228513449f
requires 1.30.0.
2018-12-18 23:17:43 +01:00
Christian Legnitto
0793e22f62 Add changelog replacements for subcrates 2018-12-18 11:19:19 -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
81214dd5bf Fix typo 2018-12-17 15:15:56 -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
32c8979399 Tweak changelog rewriting 2018-12-17 15:01:31 -08:00
Christian Legnitto
bd4f3c7fa1 Don't use dev version for integration crates 2018-12-17 14:51:28 -08:00
Christian Legnitto
56954b15dc Fix publishing juniper atfter juniper_codegen 2018-12-17 14:49:27 -08:00
Christian Legnitto
f52c0e141e Don't use a dev version 2018-12-17 14:48:29 -08:00
Christian Legnitto
8b2ec00a92 Bump juniper_codegen version to 0.11.1-pre 2018-12-17 14:43:57 -08:00
Christian Legnitto
bcf2223e89 Automate updating versions in changelog
This is part of https://github.com/graphql-rust/juniper/issues/248
2018-12-17 14:04:46 -08:00
Christian Legnitto
905c73af78 Move juniper changelog to a single file in juniper crate 2018-12-17 14:04:46 -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
Christoph Herzog
e2063bd932 Bump juniper_rocket to 0.2 2018-12-16 11:23:07 +01:00
Christian Legnitto
4c92b45e57 Change the order of crates in the workspace
This is needed when we use `carg-make` for releases. From
https://github.com/sagiegurari/cargo-make#usage-workspace-support:

"The order of the members is defined by the member attribute in the workspace Cargo.toml."
2018-12-12 19:20:23 -07:00
Christian Legnitto
6bc7b53ec6 Make sure we don't publish juniper_test 2018-12-12 19:18:12 -07: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
Christian Legnitto
3ce3b21eb1
Flatten juniper_warp example (#289)
This isn't needed, as examples by default are built when the
containing crate is tested.

I also confirmed that `cargo run --example warp_server` still works.
2018-12-08 20:27:23 -07:00
Christian Legnitto
78d5ab795b
Make travis builds not cache (#290)
See https://levans.fr/rust_travis_cache.html. I suspect it is causing
failures like https://travis-ci.org/graphql-rust/juniper/jobs/465442258 as
well.
2018-12-08 20:26:51 -07:00
Will Glynn
4858f90a70 Build wasm32-unknown-unknown in CI (#278)
* Build wasm32-unknown-unknown in CI (#218)

`cargo check --wasm32-unknown-unknown` is sufficient to demonstrate that the
`juniper` and `juniper_codegen` crates can compile for WebAssembly, which should
help avoid accidental regressions.
2018-12-07 12:46:22 -07:00
Christian Legnitto
e6923defb1
Fix CI (#288) 2018-12-07 11:57:17 -07:00
Christian Legnitto
7bb62ff259
Make rust 1.28 minimum supported version (#285) 2018-12-03 17:28:49 -08:00
Christian Legnitto
fe2bf611bb
Use pre-compiled cargo-make (#281) 2018-12-03 16:24:41 -08:00
Brendan Ball
e2212a539a Add method to scalar (#283) 2018-11-29 09:47:19 -08:00
Georg Semmler
4ecf558066 Use doc comments instead of the doc attribute in the changelog examples (#273) 2018-11-11 14:58:50 -08:00
Kevin Stenerson
0f2a654471 Infer graphql "deprecation" from #[deprecated(note = "...")] in derive (and macros) (#269)
* Update object/iface macro with doc/deprecated attrs for fields

* Use the note from `#[deprecated]` by default in derived GraphQLType

* Update to support multiline raw-docstring format

* Support bare deprecated attribute

* Update arguments to support #[doc] for parity with previous ` as ` syntax
2018-10-27 21:28:48 -06:00
Christian Legnitto
f61fdb2063
Add previous juniper_warp changes to the changelog
Fixes https://github.com/graphql-rust/juniper/issues/268
2018-10-27 19:00:32 -07:00
Christian Legnitto
86fdd25ac7
Upgrade juniper_warp to warp 0.1.8 (#271)
This unbreaks the build, as the newer warp deprecates some of the filters we
were using and we had `deny_warnings` on.
2018-10-27 19:45:47 -06:00
Cole Graber-Mitchell
cf7e8df65f Make operation_name public (#265)
Fixes #253.
2018-10-23 06:09:39 -06:00
Tom Houlé
edecb8c99f Get rid of futures_cpupool in juniper_warp (fixes #258) 2018-10-23 06:01:06 -06:00
Christian Legnitto
3266c237e9 Fix build 2018-10-23 05:45:12 -06:00
Tom Houlé
95dc436bb3 Rename graphiql_handler to graphiql_filter in juniper_warp (#267)
This is a more idiomatic name for warp, and it _is_ a filter.
2018-10-22 22:05:01 -06: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
bd455c9130
Remove Appveyor (#264)
Now that we have azure pipelines set up, there is no need
to use appveyor.

Part of https://github.com/graphql-rust/juniper/issues/259
2018-10-08 21:15:09 -07:00
Christian Legnitto
592060d3f2
Set up CI with Azure Pipelines (#263) 2018-10-08 14:45:49 -07:00
Dylan DPC
95efe3821c Update uuid to 0.7 (#262) 2018-10-07 11:11:06 -07:00
Christian Legnitto
e8a83ac816
Update Makefile.toml 2018-10-02 22:24:54 -07:00
Christian Legnitto
61ea25f61b
Use latest cargo make (#260) 2018-10-02 14:53:09 -07:00