tyranron
dc19d85fae
Tune lints for 1.83 Rust
2024-11-29 15:26:08 +01:00
tyranron
2682ee1418
Make Clippy happy for 1.78 Rust
2024-05-02 18:03:27 +02:00
tyranron
aea0ef2549
Make Clippy happy for 1.77 Rust
2024-03-22 17:59:16 +02:00
Kai Ren
f363b0d79e
Preserve input body when attribute macro expansion fails ( #1245 , #1244 )
2024-01-30 16:41:11 +01:00
Kai Ren
9420f3c19e
Allow top-level #[graphql]
attribute in attribute macros ( #1232 )
2023-12-11 20:31:04 +00:00
dependabot[bot]
782eccba47
Upgrade syn
crate to 2.0 version ( #1157 )
...
- replace `proc-macro-error` crate with simplified `common::diagnostic::pollyfill`
- migrate `juniper_codegen_tests` to stable Rust
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kai Ren <tyranron@gmail.com>
2023-11-01 19:00:05 +01:00
tyranron
17a02fa766
Correct fully qualified paths in generated code ( #1195 , #1194 )
2023-10-13 19:28:42 +03:00
Peter Holloway
801820a3b6
Use fully qualified paths in generated code ( #1195 )
...
If user code has a type alias (or custom type) called `Result` or
`Option` etc, this would be used instead of the intended standard
library types causing surprising compile errors from generated code.
Using the fully qualified path allows the generated code to be isolated
from user types.
Includes two basic regression tests covering `Result` and `Send`.
Fixes #1194
2023-10-06 11:59:00 -07:00
tyranron
3a68877de0
Tune up for 1.65 Rust
2022-11-04 19:05:09 +01:00
tyranron
0df1e448e8
Tune up for 1.63 Rust
2022-08-12 17:03:06 +03:00
tyranron
ef7a7e8229
Upgrade to 2021 Rust edition
...
- set 1.62 Rust as MSRV
- use new fmt syntax where possible
- refactor `.to_owned()`, `.to_string()` and `.into()` usage
- rename `IntoResolvable::into()` as `IntoResolvable::into_resolvable()` to disambiguate with `Into::into()`
- use `#[derive(Default)]` for enums where possible
- use `bool::then_some()` where possible
2022-07-13 15:20:10 +02:00
tyranron
576d6fb6dd
Finish refactoring juniper_codegen
crate
2022-07-11 17:06:05 +02:00
ilslv
0c8bcf582f
Fix input value coercion with defaults ( #1080 , #1073 )
2022-07-08 21:55:51 +00:00
ilslv
a32140cd46
Update all links to October 2021 spec ( #1075 , #1000 )
...
Co-authored-by: Kai Ren <tyranron@gmail.com>
2022-06-28 15:32:08 +00:00
ilslv
927e42201a
Rework #[derive(GraphQLInputObject)]
macro implementation ( #1052 )
...
Co-authored-by: Kai Ren <tyranron@gmail.com>
2022-06-28 11:27:28 +00: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
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
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
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
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
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
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