Commit graph

77 commits

Author SHA1 Message Date
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
6aa6385437
Bump up MSRV to 1.65.0 2022-12-19 09:31:23 +01:00
Kai Ren
f3df70693c
Improve CI (#1113)
- switch to `dtolnay/rust-toolchain` GitHub action
- restore release Git tag format and correct `cargo-release` integration
- enable MSRV check
- integrate `cargo-careful`
2022-10-21 16:07:17 +00:00
tyranron
e9482c3f18
Fix codegen tests for latest nightly Rust 2022-08-29 17:10:40 +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
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
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
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
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
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
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
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
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
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
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
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
Caio
2ab00f55d6
Remove unused dependencies (#747) 2020-08-28 20:34:11 -10:00
Kai Ren
ddc1488195
Codegen reimplementation for GraphQL unions (#666)
- reimplement #[derive(GraphQLUnion)] macro to support:
    - both structs and enums
    - generics in type definition
    - multiple #[graphql] attributes
    - external resolver functions
- remove From trait impls generation for enum variants

- reimplement #[graphql_union] macro to support:
    - traits
    - generics in trait definition
    - multiple attributes
    - external resolver functions
    - GraphQLType implemetation for a raw trait object
    - GraphQLTypeAsync implemetation (#549)

- add marker::GraphQLUnion trait

- rewrite "2.5 Unions" section in Book (Juniper user documentation)

- rewrite `codegen` and `codegen_fail` integration tests for GraphQL unions

Additionally:
- re-export `futures` crate in `juniper` for convenient reuse in the generated code without requiring library user to provide `futures` crate by himself (#663)
- use unit type () as default context for EmptyMutation and EmptySubscriptions
- relax Sized trait bound on some GraphQLType and GraphQLTypeAsync definitions, implementations and usages
2020-06-04 11:19:01 +03:00
Jonas Meurer
558eae91df
Ensure Specification(June 2018) Compliance (#631)
* Implemented most test cases from the specification

* Unified error handling for all generators

- Removed proc-macro-error -> not required -> use syn::Error
- Everything below lib.rs uses proc_macro2::TokenStream
  instead of proc_macro::TokenStream
- Replaced error handling in attribute parsers

* WIP better error messages for *all* macros

* Refactored GraphQLInputObject and minor tweaks

- removed support for Scalar within a string ("DefaultScalarValue")
- removed unraw function and replaced it with the built-in one
- added error messages and return types for all functions within utils
- added more constraints to fulfill the GraphQL spec

* Fixed test-cases which are not compliant with the specification

* Removed unused function

* Added constrains, updated error messages, added marker

* Added argument rename within impl_graphql and fixed `__` tests

* Formatted and cleanup

* Added GraphQLTypeAsync for input object

* Moved codegen tests to separate module

Nightly and stable produce different outputs, thus only test nightly.

* Added IsInputType/IsOutputType traits for type checking

Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
2020-05-01 16:24:01 -10: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
Christian Legnitto
b63a44e0f8
Add futures dependency (#541)
Fixes https://github.com/graphql-rust/juniper/issues/534.

I am not sure if the best way is to have folks bring their own futures for the
derives / macros or to pull it in as a dep explicitly like I have done here.

Because people are filing issues, we will do it this way and see what other issues arise.
2020-02-20 21:53:39 -07:00
tyranron
c51c675306
Use caret requirement for specifying 'futures' crate version 2020-02-04 09:57:47 +01:00
Christian Legnitto
80ef24fc12 Break dep cycle again 2020-01-21 07:53:36 -08:00
Christian Legnitto
98caeefbc0 Break dep cycle with features 2020-01-21 00:02:26 -08:00
Christian Legnitto
c6becfe234 Fix juniper_codegen tests under async 2020-01-20 23:38:44 -08:00
Christian Legnitto
73dc5cd5b8 Release juniper 0.14.2 2020-01-18 17:14:35 -08:00
Christian Legnitto
a5ccf8c2a1 Release juniper_codegen 0.14.2 2020-01-18 17:14:35 -08:00
nWacky
09d9513da9
Rebase onto master 2019-11-06 11:45:19 +03:00
Christoph Herzog
ee9a82a817 Refacto graphql_union! macro to proc macro 2019-10-28 21:51:29 +01:00
Christoph Herzog
56a4f2558a WIP async/await implementation 2019-10-09 22:22:13 -07:00
Christian Legnitto
dbbceae643 Release juniper 0.14.0 2019-09-29 19:04:31 -07:00
Christian Legnitto
c4d7661b3b Release juniper_codegen 0.14.0 2019-09-29 19:03:54 -07:00