Commit graph

140 commits

Author SHA1 Message Date
Christian Legnitto
71731c8cb2 Release juniper_warp 0.6.2 2021-01-27 20:56:46 -10:00
Christian Legnitto
3638e1e65e Release juniper_graphql_ws 0.2.3 2021-01-27 20:35:52 -10:00
Christian Legnitto
212f896e40 Release juniper 0.15.3 2021-01-27 17:54:00 -10:00
Christian Legnitto
c6a9774b44 Release juniper_warp 0.6.1 2021-01-15 19:54:43 -10:00
Christian Legnitto
d4c97fdc77 Release juniper_graphql_ws 0.2.2 2021-01-15 19:53:42 -10:00
Christian Legnitto
186186a603 Release juniper 0.15.2 2021-01-15 19:46:23 -10:00
Christian Legnitto
7da9f6fcd6 Release juniper_graphql_ws 0.2.1 2020-12-12 09:52:41 -10:00
Christian Legnitto
b2a3b097bd Release juniper 0.15.1 2020-12-12 09:48:31 -10:00
Christian Legnitto
0c83ffde2a
Fix release replacements. (#825)
Some crates need to rewrite values when they are released in other crates. It turns out, by default we use a general config _build/release.toml. So it turns out these local-to-the-crate release.tomls were not being used unless explicitly chosen in the local-to-the-crate Makefile.toml. This removes the dead release.tomls and overrides the ones that need to edit other crates on release.
2020-12-11 19:20:05 -10:00
Christian Legnitto
9a8d98a0b1 Release juniper_warp 0.6.0 2020-12-09 20:06:03 -10:00
Christian Legnitto
270deb24dc Fix warp releases 2020-12-09 20:05:14 -10:00
Christian Legnitto
bfe627e573 Release juniper 0.15.0 2020-12-09 19:19:43 -10:00
Kai Ren
a4871887bb
Default to generic ScalarValue in #[graphql_object] macro (#779)
* Change codegen ScalarValue defaults for #[graphql_object] macro

* Fix integration tests

* Fix codegen failure tests

* Fix 'juniper' crate tests

* Fix integration crates tests

* Fix 'juniper_benchmarks' crate

* Fix examples

* Fix Book

* Fix

* Add CHANGELOG entry

* Some Book corrections

* Fix

* Bootstrap coercion machinery

* Reimpl coercion

* Correct tests, vol.1

* Correct tests, vol.2

* Correct tests, vol.3

* Correct tests, vol.4

* Correct tests, vol.5

* Fix coercion for subscriptions

* README fixes

Co-authored-by: Christian Legnitto <christian@legnitto.com>
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-11-06 18:15:18 -08:00
Kai Ren
421b343398
Remove redundant extern crate usages (#790)
Additionally:
- remove obsolete benches in benches/ dir
- restore benches in juniper/benches/ dir
2020-10-19 19:42:27 +03:00
dependabot-preview[bot]
dd69375e59
Upgrade 'env_logger' crate to 0.8 version (#789)
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-19 12:23:17 +03:00
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
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
Christopher Brown
54e0e208fc Small typo fix in juniper_warp comment 2020-08-03 16:05:50 -04:00
Chris
84c9720b53
GraphQL-WS crate and Warp subscriptions update (#721)
* update pre-existing juniper_warp::subscriptions

* initial draft

* finish up, update example

* polish + timing test

* fix pre-existing bug

* rebase updates

* address comments

* add release.toml

* makefile and initial changelog

* add new Cargo.toml to juniper/release.toml
2020-07-28 22:23:44 -10:00
Chris
7b9cf4cb18
fix for warp content type filter (#724) 2020-07-28 16:03:07 -10:00
Christian Legnitto
fe6d622008
Update percent_encoding (#715)
Replaces https://github.com/graphql-rust/juniper/pull/702
2020-07-24 17:27:38 -10:00
Jerel Unruh
de8b2af0d7
Add clone() back to request_id to fix compiler error in juniper_warp (#712)
This is the last item required to close #705
2020-07-20 20:08:45 -10:00
Chris
825a35c686
Fix juniper_warp subscriptions (#707)
* use anyhow::anyhow for subscriptions mod

* remove unnecessary Clone

* fix simultaneous subscriptions

* rm unnecessary .clone
2020-07-18 11:00:17 -10:00
dependabot-preview[bot]
e730f6b336
Update env_logger requirement from 0.5.11 to 0.7.1 (#701)
Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
- [Release notes](https://github.com/sebasmagri/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sebasmagri/env_logger/compare/v0.5.11...v0.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-16 20:06:39 -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
Kunjan Dalal
0dcfb850e1
failure removed in favour of thiserror and anyhow (#696) 2020-07-10 22:02:32 -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
imspace
37a37d462f
fix: endless poll on an errored ws stream (#683)
* fix: endless poll on an errored ws stream
2020-06-24 18:23:13 -10:00
Kai Ren
5b9c6111f1
Relax redundant 'static lifetime bounds on ScalarValue in juniper_subscriptions::Coordinator (#680) 2020-06-10 21:27:58 -10: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
Jordão Rodrigues Oliveira Rosario
926d4e5738
Changed implementation location for GraphQLBatchRequest/Response (#608) 2020-04-09 19:35:30 -10:00
Jairo H Wiethan
c12f40c0f5
Removed 'compat' feature from futures on juniper_subscriptions and juniper_warp (#606) 2020-04-08 15:40:22 -10:00
Christian Legnitto
adc8d7be2d
Fix some clippy warnings (#595) 2020-03-31 08:34:50 -07:00
nWacky
dbe2c67cb8
Minor improvements to subscriptions functionality (#591)
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-03-30 20:43:00 -07: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
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
tyranron
c51c675306
Use caret requirement for specifying 'futures' crate version 2020-02-04 09:57:47 +01:00
Christian Legnitto
d22fab76c8 Fix clippy lints in warp 2020-01-22 07:56:03 -08:00
Christian Legnitto
fc7827605c Release juniper_warp 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
ce3cf45ca9 Rename object proc macro to graphql_object 2019-11-16 02:57:48 +01:00
Christoph Herzog
38c3e28f22 Disable async tests on CI 2019-11-15 21:44:24 +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
nWacky
778606c050
Fix bad merge [skip ci] 2019-11-06 12:01:50 +03:00
nWacky
2404b81008
Rebase onto master 2019-11-04 18:52:26 +03:00
Christian Legnitto
91a9752166 Release juniper_warp 0.5.1 2019-10-24 16:03:00 -07:00
Christian Legnitto
c434bddc91 Release juniper 0.14.1 2019-10-24 15:57:16 -07:00
Christian Legnitto
61c0543523 Release juniper_warp 0.5.0 2019-09-29 19:11:04 -07:00
Christian Legnitto
dbbceae643 Release juniper 0.14.0 2019-09-29 19:04:31 -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
237febe328 Release juniper_warp 0.4.1 2019-07-29 08:12:47 -07:00
Christian Legnitto
48c26a26b3 Release juniper 0.13.1 2019-07-29 08:08:05 -07:00
Christian Legnitto
90886c0fd2 Release juniper_warp 0.4.0 2019-07-19 14:27:08 -07:00
Christian Legnitto
54f98f46db Release juniper 0.13.0 2019-07-19 14:01:21 -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
4eea56351b Release juniper_warp 0.3.0 2019-05-16 19:14:16 -07:00
Christian Legnitto
9c9e3da72d Release juniper 0.12.0 2019-05-16 19:03:21 -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
Christoph Herzog
29025e6cae
Rename impl_object to object. 2019-05-13 21:15:14 +02:00
Christoph Herzog
f72f808be3
(warp) impl_object refactor 2019-05-12 10:36:30 +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
Camille TJHOA
a3699ff161 Fix juniper_warp example path (#323) 2019-02-20 07:49:16 -07:00
Jakob Gillich
b4a0669b37 Add GraphQL Playground integration (#317) 2019-01-25 20:58:01 -08:00
theduke
036152efb4
juniper_warp: Fix example link in lib.rs docs 2018-12-30 15:12:58 +01: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
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
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
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
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
Christian Legnitto
64da0bdbe5
FIx link to juniper_warp docs 2018-09-30 11:19:33 -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
Tom Houlé
fd636e07df Add integration crate for the warp framework (#216) 2018-09-07 14:28:56 -07:00