- 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
- 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
- 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
- support `isRepeatable` field on directives
- support `__Schema.description`, `__Type.specifiedByURL` and `__Directive.isRepeatable` fields in introspection
* 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
- 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
* 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>
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.