Commit graph

212 commits

Author SHA1 Message Date
tyranron
ba1ed85b3c
Relax object safety requirement for GraphQLValue and GraphQLValueAsync traits 2022-04-19 16:33:10 +03:00
Cerber-Ursi
c40d80f26b
Fix expansion of procedural macros inside macro_rules! (#1054, #1051) 2022-04-13 16:15:50 +03:00
Kai Ren
72ed45a77c
Rework CI and project toolchain (#1043)
- remove `cargo-make` integration
- rework CI pipeline more granular and precise
- rework releasing process
- tune up project layout
- fill up new CHANGELOGs

Additionally:
- fix latest nightly/stable Rust inconsistencies
2022-04-08 17:44:50 +03:00
ilslv
d0b56f9222
Implement #[derive(GraphQLInterface)] to use structs as GraphQL interfaces (#1026)
- support `#[graphql_interface]` on structs
2022-04-01 21:10:45 +03:00
tyranron
4182a8cf2b
Fix tests for 1.0.90 syn version 2022-03-29 12:28:25 +03:00
ilslv
5bbc73ad89
Redesign #[derive(ScalarValue)] macro to derive ScalarValue on enums (#1025) 2022-03-03 15:49:35 +02:00
ilslv
0ebd19af5a
Redesign #[derive(GraphQLScalar)] and #[graphql_scalar] macros (#1017)
- `#[derive(GraphQLScalar)]`:
    - support generic scalars
    - support structs with single named field
    - support for overriding resolvers
- `#[graphql_scalar]`:
    - support `transparent` argument

Co-authored-by: Kai Ren <tyranron@gmail.com>
2022-02-28 11:34:38 +02:00
ilslv
63198cdfcb
Redesign #[graphql_scalar] macro (#1014, #1000)
- support generic scalars
- make it applicable to type aliases and struct/enums/unions
2022-02-24 17:12:17 +02:00
tyranron
77d4c90b23
Bump up juniper and juniper_codegen version to 0.16.0-dev to disambiguate release automation on CI 2022-02-02 20:08:41 +02:00
tyranron
589acb5a7b
Merge security fixes from 0.15 juniper releases 2022-02-02 19:37:24 +02:00
tyranron
855137cde6
Release juniper 0.15.9 2022-02-02 18:33:41 +02:00
tyranron
a0a566bc5b
Release juniper_codegen 0.15.9 2022-02-02 18:28:30 +02:00
Christian Legnitto
3025ab0a4a Release juniper 0.15.8 2022-01-26 23:28:49 -08:00
Christian Legnitto
1fd518e72c Release juniper_codegen 0.15.8 2022-01-26 23:28:15 -08:00
Christian Legnitto
4b0aabe9f6 More breaking changes with cargo-release 0.19.0 2022-01-26 23:21:46 -08:00
Christian Legnitto
399a79056a Update key for newer cargo-release 2022-01-26 22:47:29 -08:00
ilslv
1aa1000c3b
Redesign #[graphql_interface] macro (#1009, #1000, #814)
- remove support for `#[graphql_interface(dyn)]`
- describe all interface trait methods with type's fields or impl block instead of `#[graphql_interface]` attribute on `impl Trait`
- forbid default impls on non-skipped trait methods
- support additional nullable arguments on implementer
- support returning sub-type on implementer
2022-01-26 20:58:53 +02:00
ilslv
847d09fb5e
Support @specifiedBy(url: "...") directive via specified_by_url attribute argument in #[graphql_scalar] and #[derive(GraphQLScalarValue)] macros (#1003, #1000)
- support `isRepeatable` field on directives
- support `__Schema.description`, `__Type.specifiedByURL` and `__Directive.isRepeatable` fields in introspection
2021-12-20 13:36:27 +02:00
Kai Ren
46be97ada4
Refactor FromInputValue to return Result instead of Option (#987)
- propagate `FromInputValue` conversion errors during validation
- replace panics with errors during resolving

Co-authored-by: ilslv <ilya.solovyiov@gmail.com>
2021-12-14 19:30:27 +02:00
Kai Ren
f66296d618
Replace ScalarValue::Visitor with DeserializeOwned requirement (#985)
- remove `Serialize` impl from `#[derive(GraphQLScalarValue)]` macro expansion
2021-10-11 21:53:04 +03:00
nickelc
b9257ef7d4
Fix Clippy warnings (#980) 2021-09-12 20:38:41 +03:00
Kai Ren
a3fda7363d
Rework codegen for GraphQL objects and subscriptions (#971, #421)
- preserve and reuse defined impl blocks in #[graphql_object] and #[graphql_subscription] macros expansion
- allow renaming `ScalarValue` type parameter in expanded code via `scalar = S: ScalarValue` syntax

Additionally:
- rename `rename` attribute's argument to `rename_all`
- support `rename_all` in #[graphql_interface] macro
2021-08-11 17:41:49 +03:00
Kai Ren
39d1e43420
Allow using Rust arrays as GraphQL lists (#918) (#966)
* Provide impls for arrays

* Remove redundant Default bound

* Recheck other places of mem::transmute usage

* Fix missing marker impls

* Extend GraphQL list validation with optional expected size

* Improve input object codegen

* Cover arrays with tests

* Add CHANGELOG entry

* Consider panic safety in FromInputValue implementation for array

* Tune up codegen failure tests
2021-07-23 14:51:47 -10:00
tyranron
ad64025572
Strip redundant fields in codegen producing warnings 2021-07-21 18:16:29 +03:00
Christian Legnitto
88b10fe009 Release juniper 0.15.7 2021-07-08 00:01:56 -07:00
Christian Legnitto
f50ef5dfaa Release juniper_codegen 0.15.7 2021-07-08 00:00:55 -07:00
Christian Legnitto
28c116411d
Switch releasing commands from a blocklist to an allowlist (#956)
* Switch releasing commands from a blocklist to an allowlist

This is much better as we can hardocde the crates to filter out in
one place, can selectively release certain crates easily,
and only have one command instead of the "-some" hack

* get rid of workaround no longer needed

* More makefiles
2021-07-07 23:47:16 -07:00
Filip Gospodinov
de4c0e9088
juniper_codegen: macro hygiene for graphql_subscription (#948)
Fully qualify `std::result::Result` such that it doesn't
collide with locally defined type aliases for `Result`.
This improves macro hygiene.
2021-06-26 13:15:41 -10:00
Christian Legnitto
5dee177fb1 Release juniper 0.15.6 2021-06-07 18:23:16 -07:00
Christian Legnitto
3d57c8316d Release juniper_codegen 0.15.6 2021-06-07 18:22:09 -07:00
ihor-rud
d3896bd33c
Fix using graphql_scalar proc macro inside a macro (#933) 2021-06-06 15:05:53 -07:00
tyranron
e998457c0e
Release juniper 0.15.5 2021-05-11 17:38:32 +03:00
tyranron
c3a04d7d22
Release juniper_codegen 0.15.5 2021-05-11 17:08:34 +03:00
xDarksome
f04434416b
Fix subscription error extensions (#927) 2021-05-11 10:43:52 +03:00
tyranron
70bc9c4512
Make Clippy almost happy on latest Rust 2021-05-10 12:18:31 +03:00
Christian Legnitto
97d8b70ea0 Release juniper 0.15.4 2021-04-03 15:36:50 -10:00
Christian Legnitto
1815d23194 Release juniper_codegen 0.15.4 2021-04-03 15:35:33 -10:00
Christian Legnitto
ed3bb68329
Add min so newer cargo-release doesn't fail (#909) 2021-04-03 15:13:25 -10:00
Christian Legnitto
212f896e40 Release juniper 0.15.3 2021-01-27 17:54:00 -10:00
Christian Legnitto
fc1c7dfe63 Release juniper_codegen 0.15.3 2021-01-27 17:53:14 -10:00
Graeme Coupar
824cd4081b
Update juniper_codegen for syn 1.0.60 (#861)
* Update juniper_codegen for syn 1.0.60

syn 1.0.60 has updated it's `Type::__Nonexhaustive` to
`Type::TestExhaustive`, breaking juniper.  This updates juniper to use
the recommended idiom for doing exhaustive matching on `Type`, which
fixes this.

Not entirely clear if we need exhaustive matching here or if we could
just use a fallback, but this fixes the build at least.

Also updated the minimum syn so users have to pull it in

* Update example to use relative deps

As otherwise CI fails on this branch
2021-01-26 07:41:03 -10:00
Christian Legnitto
186186a603 Release juniper 0.15.2 2021-01-15 19:46:23 -10:00
Christian Legnitto
948517b84f Release juniper_codegen 0.15.2 2021-01-15 19:44:23 -10:00
Christian Legnitto
b2a3b097bd Release juniper 0.15.1 2020-12-12 09:48:31 -10:00
Christian Legnitto
f1f64446b5 Release juniper_codegen 0.15.1 2020-12-12 09:47:47 -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
6326acde33
Fix some clippy lints (#809) 2020-12-10 21:41:23 -10:00
Christian Legnitto
bfe627e573 Release juniper 0.15.0 2020-12-09 19:19:43 -10:00
Christian Legnitto
d63fdef321 Release juniper_codegen 0.15.0 2020-12-09 19:19:00 -10:00
Zak
4ffd276a5b
Allow raw identifier for field arguments in #[graphql_object] macro (#812, #786) 2020-11-26 12:46:06 +02:00