- `#[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>
- 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
- add `From` impls to `InputValue` mirroring `Value` impls to provide better support for `Option` handling
- support expressions in `graphql_value!` macro
- use `null` in addition to `None` to create `Value::Null` in `graphql_value!` macro to mirror `serde_json::json!`
- use macros for `InputValue` and `Variables` construction in tests
Co-authored-by: Ilya Solovyiov <ilya.solovyiov@gmail.com>
- 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
* Make the executor and validation APIs public to enable splitting parsing and execution into two stages
Based on https://github.com/graphql-rust/juniper/pull/773#issuecomment-703783048 and https://github.com/graphql-rust/juniper/pull/773#issuecomment-704009918
* Fix fmt warning for visit_all_rules
* Add `Definition` to the public API so it's available for the result of compilation
* Make OperationType public so that user land code can tell the difference between query/mutation and subscription
* Add integrations tests for execute_validated_query_async, visit_all_rules, get_operation, and resolve_validated_subscription
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
* Resolves#818. Updates Object key_value_list to use HashMap<String, Value<S>>. Updates test cases.
* Updates to use IndexMap. Reverts changes to test cases.
Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>
* Mark `Arc` with `IsInputType` & `IsOutputType`.
We've just updated a service we work with to the latest release of
juniper (it's been on a fairly old master commit for some time). In
this service we have some fields that are contained within `Arc`s, which
I added support for in #479.
Since then it seems the new marker traits of `IsInputType` &
`IsOutputType` have been added, but they do not support `Arc`, leading
to:
```
error[E0277]: the trait bound `Arc<menu::Menu>: IsOutputType<__S>` is not satisfied
--> src/graphql.rs:36:1
|
36 | #[juniper::graphql_object(Context=Context)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `Arc<menu::Menu>`
|
= note: required by `juniper::marker::IsOutputType::mark`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
```
This commit adds support for those, mirroring the support for `Box`.
I'm not sure if there's a good place to add a test for this
functionality so that regressions can be avoided in the future?
* Add Arc tests & FromInputValue for Arc<T>
- add associated type to IntoResolvable and IntoFieldResult traits allowing to name the GraphQLType being resolved
- relax Sized requirement on some IsInputType and IsOutputType impls
* Update compile fail tests for latest Rust
The messages appear to have changed on nightly
* Fix tests depending on fixture data
* Fix more integration test paths
* Fix doc warnings
- add object safe GraphQLValue, GraphQLValueAsync and GraphQLSubscriptionValue traits containing methods for value resolution
- refactor GraphQLType, GraphQLTypeAsync and GraphQLSubscriptionType traits to register and provide GraphQL type information only