From f504da6d15f5c2b314372ca80afb0f4739fc0597 Mon Sep 17 00:00:00 2001 From: ilslv <47687266+ilslv@users.noreply.github.com> Date: Mon, 20 Dec 2021 15:50:49 +0300 Subject: [PATCH] Fix `juniper_codegen_tests` assertions (#1007) --- .../fail/enum/derive_no_fields.stderr | 7 ++- .../derive_incompatible_object.stderr | 43 ++++++++----------- .../fail/input-object/derive_no_fields.stderr | 7 ++- .../input-object/derive_no_underscore.stderr | 5 +-- .../input-object/derive_unique_name.stderr | 12 +++--- .../argument_double_underscored.stderr | 11 +++-- .../interface/argument_non_input_type.stderr | 30 ++++++++----- .../argument_wrong_default_array.stderr | 7 ++- ...conflicts_with_external_downcast_fn.stderr | 15 +++---- .../downcast_method_wrong_input_args.stderr | 13 +++--- .../downcast_method_wrong_return_type.stderr | 7 ++- .../interface/field_double_underscored.stderr | 5 +-- .../field_non_output_return_type.stderr | 17 +++----- .../fail/interface/fields_duplicate.stderr | 15 ++++--- .../implementer_non_object_type.stderr | 22 +++------- .../interface/name_double_underscored.stderr | 7 ++- .../fail/interface/no_fields.stderr | 13 +++--- .../object/argument_double_underscored.stderr | 5 +-- .../object/argument_non_input_type.stderr | 30 ++++++++----- .../argument_wrong_default_array.stderr | 7 ++- .../attr_field_non_output_return_type.stderr | 17 +++----- .../fail/object/attr_fields_duplicate.stderr | 5 +-- .../attr_name_double_underscored.stderr | 5 +-- .../fail/object/attr_no_fields.stderr | 5 +-- .../derive_field_double_underscored.stderr | 5 +-- ...derive_field_non_output_return_type.stderr | 17 +++----- .../object/derive_fields_duplicate.stderr | 13 +++--- .../derive_name_double_underscored.stderr | 5 +-- .../fail/object/derive_no_fields.stderr | 7 ++- .../fail/object/derive_wrong_item.stderr | 2 +- .../fail/scalar/impl_invalid_url.stderr | 2 +- .../argument_double_underscored.stderr | 5 +-- .../argument_non_input_type.stderr | 30 ++++++++----- .../argument_wrong_default_array.stderr | 7 ++- .../field_non_output_return_type.stderr | 17 +++----- .../fail/subscription/field_not_async.stderr | 9 ++-- .../fail/subscription/fields_duplicate.stderr | 5 +-- .../name_double_underscored.stderr | 5 +-- .../fail/subscription/no_fields.stderr | 5 +-- .../fail/union/derive_wrong_item.stderr | 2 +- ...s_with_variant_external_resolver_fn.stderr | 5 +-- .../union/enum_name_double_underscored.stderr | 5 +-- .../fail/union/enum_no_fields.stderr | 7 ++- .../fail/union/enum_non_object_variant.stderr | 17 +++----- .../fail/union/enum_same_type_pretty.stderr | 12 +++--- .../union/enum_wrong_variant_field.stderr | 10 ++--- .../struct_name_double_underscored.stderr | 5 +-- .../fail/union/struct_no_fields.stderr | 7 ++- .../union/struct_non_object_variant.stderr | 17 +++----- .../union/trait_fail_infer_context.stderr | 22 +++------- ...conflicts_with_external_resolver_fn.stderr | 9 ++-- .../trait_name_double_underscored.stderr | 5 +-- .../fail/union/trait_no_fields.stderr | 7 ++- .../union/trait_non_object_variant.stderr | 17 +++----- .../fail/union/trait_same_type_pretty.stderr | 12 +++--- .../union/trait_with_attr_on_method.stderr | 7 ++- .../trait_wrong_method_input_args.stderr | 7 ++- .../trait_wrong_method_return_type.stderr | 7 ++- 58 files changed, 281 insertions(+), 343 deletions(-) diff --git a/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr b/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr index 8c7fc360..63715639 100644 --- a/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL enum expects at least one field - - = note: https://spec.graphql.org/June2018/#sec-Enums - --> fail/enum/derive_no_fields.rs:2:1 | 2 | pub enum Test {} - | ^^^ + | ^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Enums diff --git a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr b/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr index 6c4e0ed6..fd21efcc 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr @@ -1,15 +1,23 @@ error[E0277]: the trait bound `ObjectA: IsInputType<__S>` is not satisfied - --> fail/input-object/derive_incompatible_object.rs:6:10 - | -6 | #[derive(juniper::GraphQLInputObject)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjectA` - | -note: required by `juniper::marker::IsInputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the derive macro `juniper::GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/input-object/derive_incompatible_object.rs:6:10 + | +6 | #[derive(juniper::GraphQLInputObject)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjectA` + | + = note: this error originates in the derive macro `juniper::GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied + --> fail/input-object/derive_incompatible_object.rs:6:10 + | +6 | #[derive(juniper::GraphQLInputObject)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA` + | +note: required by a bound in `Registry::<'r, S>::arg` + --> $WORKSPACE/juniper/src/executor/mod.rs + | + | T: GraphQLType + FromInputValue, + | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` + = note: this error originates in the derive macro `juniper::GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied --> fail/input-object/derive_incompatible_object.rs:6:10 @@ -19,19 +27,6 @@ error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied | = note: this error originates in the derive macro `juniper::GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied - --> fail/input-object/derive_incompatible_object.rs:6:10 - | -6 | #[derive(juniper::GraphQLInputObject)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA` - | -note: required by `from_input_value` - --> $WORKSPACE/juniper/src/ast.rs - | - | fn from_input_value(v: &InputValue) -> Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the derive macro `juniper::GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0599]: no method named `to_input_value` found for struct `ObjectA` in the current scope --> fail/input-object/derive_incompatible_object.rs:6:10 | diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr b/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr index edb0aa99..9362b428 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL input object expects at least one field - - = note: https://spec.graphql.org/June2018/#sec-Input-Objects - --> fail/input-object/derive_no_fields.rs:2:1 | 2 | struct Object {} - | ^^^^^^ + | ^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Input-Objects diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr b/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr index 08e36730..86a6a9b2 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/input-object/derive_no_underscore.rs:3:15 | 3 | #[graphql(name = "__test")] | ^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr b/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr index 019df45d..066fdbe6 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr @@ -1,9 +1,9 @@ error: GraphQL input object does not allow fields with the same name - - = help: There is at least one other field with the same name `test`, possibly renamed via the #[graphql] attribute - = note: https://spec.graphql.org/June2018/#sec-Input-Objects - --> fail/input-object/derive_unique_name.rs:4:5 | -4 | #[graphql(name = "test")] - | ^ +4 | / #[graphql(name = "test")] +5 | | test2: String, + | |_________________^ + | + = help: There is at least one other field with the same name `test`, possibly renamed via the #[graphql] attribute + = note: https://spec.graphql.org/June2018/#sec-Input-Objects diff --git a/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr b/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr index b36017e0..0c47e615 100644 --- a/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr @@ -1,20 +1,19 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - - --> $DIR/argument_double_underscored.rs:14:18 + --> fail/interface/argument_double_underscored.rs:14:18 | 14 | fn id(&self, __num: i32) -> &str { | ^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema error[E0412]: cannot find type `CharacterValue` in this scope - --> $DIR/argument_double_underscored.rs:4:18 + --> fail/interface/argument_double_underscored.rs:4:18 | 4 | #[graphql(impl = CharacterValue)] | ^^^^^^^^^^^^^^ not found in this scope error[E0405]: cannot find trait `Character` in this scope - --> $DIR/argument_double_underscored.rs:10:6 + --> fail/interface/argument_double_underscored.rs:10:6 | 10 | impl Character for ObjA {} | ^^^^^^^^^ not found in this scope diff --git a/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr b/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr index 44ae096b..8b87b402 100644 --- a/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr @@ -1,15 +1,23 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied - --> fail/interface/argument_non_input_type.rs:16:1 - | -16 | #[graphql_interface(for = ObjA)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` - | -note: required by `juniper::marker::IsInputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/interface/argument_non_input_type.rs:16:1 + | +16 | #[graphql_interface(for = ObjA)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` + | + = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied + --> fail/interface/argument_non_input_type.rs:16:1 + | +16 | #[graphql_interface(for = ObjA)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | +note: required by a bound in `Registry::<'r, S>::arg` + --> $WORKSPACE/juniper/src/executor/mod.rs + | + | T: GraphQLType + FromInputValue, + | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` + = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied --> fail/interface/argument_non_input_type.rs:16:1 diff --git a/integration_tests/codegen_fail/fail/interface/argument_wrong_default_array.stderr b/integration_tests/codegen_fail/fail/interface/argument_wrong_default_array.stderr index 1b7e861c..0b149ee5 100644 --- a/integration_tests/codegen_fail/fail/interface/argument_wrong_default_array.stderr +++ b/integration_tests/codegen_fail/fail/interface/argument_wrong_default_array.stderr @@ -1,12 +1,11 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied - --> $DIR/argument_wrong_default_array.rs:12:1 + --> fail/interface/argument_wrong_default_array.rs:12:1 | 12 | #[graphql_interface(for = ObjA)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | = help: the following implementations were found: - <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> - <&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>> - <&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>> + <[T; LANES] as From>> + <[bool; LANES] as From>> = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr b/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr index ce90439b..1aede59e 100644 --- a/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr +++ b/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr @@ -1,21 +1,20 @@ error: GraphQL interface trait method `as_obja` conflicts with the external downcast function `downcast_obja` declared on the trait to downcast into the implementer type `ObjA` - - = note: https://spec.graphql.org/June2018/#sec-Interfaces - = note: use `#[graphql(ignore)]` attribute argument to ignore this trait method for interface implementers downcasting - - --> $DIR/downcast_method_conflicts_with_external_downcast_fn.rs:26:5 + --> fail/interface/downcast_method_conflicts_with_external_downcast_fn.rs:26:5 | 26 | fn as_obja(&self) -> Option<&ObjA>; - | ^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Interfaces + = note: use `#[graphql(ignore)]` attribute argument to ignore this trait method for interface implementers downcasting error[E0412]: cannot find type `CharacterValue` in this scope - --> $DIR/downcast_method_conflicts_with_external_downcast_fn.rs:4:18 + --> fail/interface/downcast_method_conflicts_with_external_downcast_fn.rs:4:18 | 4 | #[graphql(impl = CharacterValue)] | ^^^^^^^^^^^^^^ not found in this scope error[E0405]: cannot find trait `Character` in this scope - --> $DIR/downcast_method_conflicts_with_external_downcast_fn.rs:10:6 + --> fail/interface/downcast_method_conflicts_with_external_downcast_fn.rs:10:6 | 10 | impl Character for ObjA { | ^^^^^^^^^ not found in this scope diff --git a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr index 543c8cff..ee9e4834 100644 --- a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr +++ b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr @@ -1,20 +1,19 @@ error: GraphQL interface expects trait method to accept `&self` only and, optionally, `&Context` - - = note: https://spec.graphql.org/June2018/#sec-Interfaces - - --> $DIR/downcast_method_wrong_input_args.rs:10:10 + --> fail/interface/downcast_method_wrong_input_args.rs:10:10 | 10 | fn a(&self, ctx: &(), rand: u8) -> Option<&Human> { - | ^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Interfaces error[E0412]: cannot find type `CharacterValue` in this scope - --> $DIR/downcast_method_wrong_input_args.rs:16:18 + --> fail/interface/downcast_method_wrong_input_args.rs:16:18 | 16 | #[graphql(impl = CharacterValue)] | ^^^^^^^^^^^^^^ not found in this scope error[E0405]: cannot find trait `Character` in this scope - --> $DIR/downcast_method_wrong_input_args.rs:22:6 + --> fail/interface/downcast_method_wrong_input_args.rs:22:6 | 22 | impl Character for Human {} | ^^^^^^^^^ not found in this scope diff --git a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr index 164c78cc..22aa7aba 100644 --- a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr @@ -1,11 +1,10 @@ error: GraphQL interface expects trait method return type to be `Option<&ImplementerType>` only - - = note: https://spec.graphql.org/June2018/#sec-Interfaces - --> fail/interface/downcast_method_wrong_return_type.rs:10:40 | 10 | fn a(&self, ctx: &(), rand: u8) -> &Human { - | ^ + | ^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Interfaces error[E0412]: cannot find type `CharacterValue` in this scope --> fail/interface/downcast_method_wrong_return_type.rs:16:18 diff --git a/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr b/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr index fdd492f5..2cdfafa6 100644 --- a/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr @@ -1,11 +1,10 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/interface/field_double_underscored.rs:14:8 | 14 | fn __id(&self) -> &str { | ^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema error[E0412]: cannot find type `CharacterValue` in this scope --> fail/interface/field_double_underscored.rs:4:18 diff --git a/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr index 19f45f69..1491540e 100644 --- a/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr @@ -1,12 +1,7 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/interface/field_non_output_return_type.rs:17:1 - | -17 | #[graphql_interface(for = ObjA)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | -note: required by `juniper::marker::IsOutputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/interface/field_non_output_return_type.rs:17:1 + | +17 | #[graphql_interface(for = ObjA)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr b/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr index ff07dbcb..284a3e1d 100644 --- a/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr +++ b/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr @@ -1,11 +1,16 @@ error: GraphQL interface must have a different name for each field - - = note: https://spec.graphql.org/June2018/#sec-Interfaces - --> fail/interface/fields_duplicate.rs:13:1 | -13 | trait Character { - | ^^^^^ +13 | / trait Character { +14 | | fn id(&self) -> &str { +15 | | "funA" +16 | | } +... | +21 | | } +22 | | } + | |_^ + | + = note: https://spec.graphql.org/June2018/#sec-Interfaces error[E0412]: cannot find type `CharacterValue` in this scope --> fail/interface/fields_duplicate.rs:4:18 diff --git a/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr b/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr index d3c55953..35c2dd0c 100644 --- a/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr @@ -4,22 +4,12 @@ error[E0277]: the trait bound `ObjA: GraphQLObject<__S>` is not satisfied 15 | #[graphql_interface(for = ObjA)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `ObjA` | -note: required by `juniper::GraphQLObject::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `ObjA: IsOutputType<__S>` is not satisfied - --> fail/interface/implementer_non_object_type.rs:15:1 - | -15 | #[graphql_interface(for = ObjA)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjA` - | -note: required by `juniper::marker::IsOutputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/interface/implementer_non_object_type.rs:15:1 + | +15 | #[graphql_interface(for = ObjA)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjA` + | + = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr b/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr index ba46779f..2cc6aa61 100644 --- a/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - - --> $DIR/name_double_underscored.rs:4:7 + --> fail/interface/name_double_underscored.rs:4:7 | 4 | trait __Character { | ^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/interface/no_fields.stderr b/integration_tests/codegen_fail/fail/interface/no_fields.stderr index 3d2e4d37..ddab0d4c 100644 --- a/integration_tests/codegen_fail/fail/interface/no_fields.stderr +++ b/integration_tests/codegen_fail/fail/interface/no_fields.stderr @@ -1,20 +1,19 @@ error: GraphQL interface must have at least one field - - = note: https://spec.graphql.org/June2018/#sec-Interfaces - - --> $DIR/no_fields.rs:13:1 + --> fail/interface/no_fields.rs:13:1 | 13 | trait Character {} - | ^^^^^ + | ^^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Interfaces error[E0412]: cannot find type `CharacterValue` in this scope - --> $DIR/no_fields.rs:4:18 + --> fail/interface/no_fields.rs:4:18 | 4 | #[graphql(impl = CharacterValue)] | ^^^^^^^^^^^^^^ not found in this scope error[E0405]: cannot find trait `Character` in this scope - --> $DIR/no_fields.rs:10:6 + --> fail/interface/no_fields.rs:10:6 | 10 | impl Character for ObjA {} | ^^^^^^^^^ not found in this scope diff --git a/integration_tests/codegen_fail/fail/object/argument_double_underscored.stderr b/integration_tests/codegen_fail/fail/object/argument_double_underscored.stderr index f93a398f..6ee3a756 100644 --- a/integration_tests/codegen_fail/fail/object/argument_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/object/argument_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/object/argument_double_underscored.rs:7:18 | 7 | fn id(&self, __num: i32) -> &str { | ^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr b/integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr index 976f8e08..44e21e0a 100644 --- a/integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr +++ b/integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr @@ -1,15 +1,23 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied - --> fail/object/argument_non_input_type.rs:10:1 - | -10 | #[graphql_object] - | ^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` - | -note: required by `juniper::marker::IsInputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/object/argument_non_input_type.rs:10:1 + | +10 | #[graphql_object] + | ^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` + | + = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied + --> fail/object/argument_non_input_type.rs:10:1 + | +10 | #[graphql_object] + | ^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | +note: required by a bound in `Registry::<'r, S>::arg` + --> $WORKSPACE/juniper/src/executor/mod.rs + | + | T: GraphQLType + FromInputValue, + | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` + = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied --> fail/object/argument_non_input_type.rs:10:1 diff --git a/integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr b/integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr index 83128b5c..27332cfe 100644 --- a/integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr +++ b/integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr @@ -1,12 +1,11 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied - --> $DIR/argument_wrong_default_array.rs:5:1 + --> fail/object/argument_wrong_default_array.rs:5:1 | 5 | #[graphql_object] | ^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | = help: the following implementations were found: - <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> - <&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>> - <&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>> + <[T; LANES] as From>> + <[bool; LANES] as From>> = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr index 4339c20e..088f406e 100644 --- a/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr +++ b/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr @@ -1,12 +1,7 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/object/attr_field_non_output_return_type.rs:10:1 - | -10 | #[graphql_object] - | ^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | -note: required by `juniper::marker::IsOutputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/object/attr_field_non_output_return_type.rs:10:1 + | +10 | #[graphql_object] + | ^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/attr_fields_duplicate.stderr b/integration_tests/codegen_fail/fail/object/attr_fields_duplicate.stderr index f22b6155..3c6968b2 100644 --- a/integration_tests/codegen_fail/fail/object/attr_fields_duplicate.stderr +++ b/integration_tests/codegen_fail/fail/object/attr_fields_duplicate.stderr @@ -1,8 +1,7 @@ error: GraphQL object must have a different name for each field - - = note: https://spec.graphql.org/June2018/#sec-Objects - --> fail/object/attr_fields_duplicate.rs:6:6 | 6 | impl ObjA { | ^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Objects diff --git a/integration_tests/codegen_fail/fail/object/attr_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/object/attr_name_double_underscored.stderr index 323003ab..031654a2 100644 --- a/integration_tests/codegen_fail/fail/object/attr_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/object/attr_name_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/object/attr_name_double_underscored.rs:6:6 | 6 | impl __Obj { | ^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/object/attr_no_fields.stderr b/integration_tests/codegen_fail/fail/object/attr_no_fields.stderr index 35a77ead..9ba0098b 100644 --- a/integration_tests/codegen_fail/fail/object/attr_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/object/attr_no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL object must have at least one field - - = note: https://spec.graphql.org/June2018/#sec-Objects - --> fail/object/attr_no_fields.rs:6:6 | 6 | impl Obj {} | ^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Objects diff --git a/integration_tests/codegen_fail/fail/object/derive_field_double_underscored.stderr b/integration_tests/codegen_fail/fail/object/derive_field_double_underscored.stderr index 09be8d8e..6a6e6403 100644 --- a/integration_tests/codegen_fail/fail/object/derive_field_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_field_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/object/derive_field_double_underscored.rs:5:5 | 5 | __test: String, | ^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr index 0a24fe8e..2a661f4c 100644 --- a/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr @@ -1,12 +1,7 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/object/derive_field_non_output_return_type.rs:8:10 - | -8 | #[derive(GraphQLObject)] - | ^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | -note: required by `juniper::marker::IsOutputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the derive macro `GraphQLObject` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/object/derive_field_non_output_return_type.rs:8:10 + | +8 | #[derive(GraphQLObject)] + | ^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = note: this error originates in the derive macro `GraphQLObject` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/derive_fields_duplicate.stderr b/integration_tests/codegen_fail/fail/object/derive_fields_duplicate.stderr index 3615a35c..18c08423 100644 --- a/integration_tests/codegen_fail/fail/object/derive_fields_duplicate.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_fields_duplicate.stderr @@ -1,8 +1,11 @@ error: GraphQL object must have a different name for each field - - = note: https://spec.graphql.org/June2018/#sec-Objects - --> fail/object/derive_fields_duplicate.rs:4:1 | -4 | struct ObjA { - | ^^^^^^ +4 | / struct ObjA { +5 | | id: String, +6 | | #[graphql(name = "id")] +7 | | id2: String, +8 | | } + | |_^ + | + = note: https://spec.graphql.org/June2018/#sec-Objects diff --git a/integration_tests/codegen_fail/fail/object/derive_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/object/derive_name_double_underscored.stderr index eb9dfb6c..809f7297 100644 --- a/integration_tests/codegen_fail/fail/object/derive_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_name_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/object/derive_name_double_underscored.rs:4:8 | 4 | struct __Obj { | ^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr b/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr index 96038236..ef198b79 100644 --- a/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL object must have at least one field - - = note: https://spec.graphql.org/June2018/#sec-Objects - --> fail/object/derive_no_fields.rs:4:1 | 4 | struct Obj {} - | ^^^^^^ + | ^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Objects diff --git a/integration_tests/codegen_fail/fail/object/derive_wrong_item.stderr b/integration_tests/codegen_fail/fail/object/derive_wrong_item.stderr index 71b8d0e5..5fc072a0 100644 --- a/integration_tests/codegen_fail/fail/object/derive_wrong_item.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_wrong_item.stderr @@ -2,4 +2,4 @@ error: GraphQL object can only be derived for structs --> fail/object/derive_wrong_item.rs:4:1 | 4 | enum Character {} - | ^^^^ + | ^^^^^^^^^^^^^^^^^ diff --git a/integration_tests/codegen_fail/fail/scalar/impl_invalid_url.stderr b/integration_tests/codegen_fail/fail/scalar/impl_invalid_url.stderr index bb2aeaee..999a04b6 100644 --- a/integration_tests/codegen_fail/fail/scalar/impl_invalid_url.stderr +++ b/integration_tests/codegen_fail/fail/scalar/impl_invalid_url.stderr @@ -1,5 +1,5 @@ error: Invalid URL: relative URL without a base - --> fail/scalar/impl_invalid_url.rs:5:22 + --> fail/scalar/impl_invalid_url.rs:5:18 | 5 | #[graphql_scalar(specified_by_url = "not an url")] | ^^^^^^^^^^^^^^^^ diff --git a/integration_tests/codegen_fail/fail/subscription/argument_double_underscored.stderr b/integration_tests/codegen_fail/fail/subscription/argument_double_underscored.stderr index 7cc24a2d..fd373703 100644 --- a/integration_tests/codegen_fail/fail/subscription/argument_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/subscription/argument_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/subscription/argument_double_underscored.rs:11:24 | 11 | async fn id(&self, __num: i32) -> Stream<'static, &'static str> { | ^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/subscription/argument_non_input_type.stderr b/integration_tests/codegen_fail/fail/subscription/argument_non_input_type.stderr index 59f35de3..45c72bce 100644 --- a/integration_tests/codegen_fail/fail/subscription/argument_non_input_type.stderr +++ b/integration_tests/codegen_fail/fail/subscription/argument_non_input_type.stderr @@ -1,15 +1,23 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied - --> fail/subscription/argument_non_input_type.rs:15:1 - | -15 | #[graphql_subscription] - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` - | -note: required by `juniper::marker::IsInputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/subscription/argument_non_input_type.rs:15:1 + | +15 | #[graphql_subscription] + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` + | + = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied + --> fail/subscription/argument_non_input_type.rs:15:1 + | +15 | #[graphql_subscription] + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | +note: required by a bound in `Registry::<'r, S>::arg` + --> $WORKSPACE/juniper/src/executor/mod.rs + | + | T: GraphQLType + FromInputValue, + | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` + = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied --> fail/subscription/argument_non_input_type.rs:15:1 diff --git a/integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.stderr b/integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.stderr index 56b033cb..4d71e80d 100644 --- a/integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.stderr +++ b/integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.stderr @@ -1,12 +1,11 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied - --> $DIR/argument_wrong_default_array.rs:10:1 + --> fail/subscription/argument_wrong_default_array.rs:10:1 | 10 | #[graphql_subscription] | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | = help: the following implementations were found: - <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> - <&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>> - <&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>> + <[T; LANES] as From>> + <[bool; LANES] as From>> = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr index a4adbdd6..090a3123 100644 --- a/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr +++ b/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr @@ -1,12 +1,7 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/subscription/field_non_output_return_type.rs:15:1 - | -15 | #[graphql_subscription] - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | -note: required by `juniper::marker::IsOutputType::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/subscription/field_non_output_return_type.rs:15:1 + | +15 | #[graphql_subscription] + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/subscription/field_not_async.stderr b/integration_tests/codegen_fail/fail/subscription/field_not_async.stderr index 344b5673..c2061179 100644 --- a/integration_tests/codegen_fail/fail/subscription/field_not_async.stderr +++ b/integration_tests/codegen_fail/fail/subscription/field_not_async.stderr @@ -1,9 +1,8 @@ error: GraphQL object synchronous resolvers are not supported - - = note: https://spec.graphql.org/June2018/#sec-Objects - = note: Specify that this function is async: `async fn foo()` - --> fail/subscription/field_not_async.rs:11:5 | 11 | fn id(&self) -> Stream<'static, bool> { - | ^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Objects + = note: Specify that this function is async: `async fn foo()` diff --git a/integration_tests/codegen_fail/fail/subscription/fields_duplicate.stderr b/integration_tests/codegen_fail/fail/subscription/fields_duplicate.stderr index 733dd6dd..34773a15 100644 --- a/integration_tests/codegen_fail/fail/subscription/fields_duplicate.stderr +++ b/integration_tests/codegen_fail/fail/subscription/fields_duplicate.stderr @@ -1,8 +1,7 @@ error: GraphQL object must have a different name for each field - - = note: https://spec.graphql.org/June2018/#sec-Objects - --> fail/subscription/fields_duplicate.rs:10:6 | 10 | impl ObjA { | ^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Objects diff --git a/integration_tests/codegen_fail/fail/subscription/name_double_underscored.stderr b/integration_tests/codegen_fail/fail/subscription/name_double_underscored.stderr index b93010ea..4752ecb0 100644 --- a/integration_tests/codegen_fail/fail/subscription/name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/subscription/name_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/subscription/name_double_underscored.rs:10:6 | 10 | impl __Obj { | ^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/subscription/no_fields.stderr b/integration_tests/codegen_fail/fail/subscription/no_fields.stderr index 8bb82802..90d4eb11 100644 --- a/integration_tests/codegen_fail/fail/subscription/no_fields.stderr +++ b/integration_tests/codegen_fail/fail/subscription/no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL object must have at least one field - - = note: https://spec.graphql.org/June2018/#sec-Objects - --> fail/subscription/no_fields.rs:6:6 | 6 | impl Obj {} | ^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Objects diff --git a/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr b/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr index 85b57e2c..379a5d69 100644 --- a/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr +++ b/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr @@ -2,4 +2,4 @@ error: GraphQL union can only be derived for enums and structs --> fail/union/derive_wrong_item.rs:4:1 | 4 | union Character { id: i32 } - | ^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr b/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr index c0f378c3..9d913d22 100644 --- a/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr @@ -1,8 +1,7 @@ error: GraphQL union variant `Human` already has external resolver function `resolve_fn1` declared on the enum - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.rs:6:15 | 6 | #[graphql(with = resolve_fn2)] | ^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr index f952d0f8..be6d0e29 100644 --- a/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/union/enum_name_double_underscored.rs:4:6 | 4 | enum __Character { | ^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr b/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr index 4d7d4f07..9ab9c400 100644 --- a/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL union expects at least one union variant - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/enum_no_fields.rs:4:1 | 4 | enum Character {} - | ^^^^ + | ^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr index ccfb6325..f0f17fbc 100644 --- a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr @@ -1,12 +1,7 @@ error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/enum_non_object_variant.rs:9:10 - | -9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | -note: required by `juniper::GraphQLObject::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/union/enum_non_object_variant.rs:9:10 + | +9 | #[derive(GraphQLUnion)] + | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr b/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr index 8a6988bf..8c432f3e 100644 --- a/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr @@ -1,8 +1,10 @@ error: GraphQL union must have a different type for each union variant - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/enum_same_type_pretty.rs:4:1 | -4 | enum Character { - | ^^^^ +4 | / enum Character { +5 | | A(u8), +6 | | B(u8), +7 | | } + | |_^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr b/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr index 26497520..f9d00963 100644 --- a/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr @@ -1,17 +1,15 @@ error: GraphQL union enum allows only unnamed variants with a single field, e.g. `Some(T)` - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/enum_wrong_variant_field.rs:5:5 | 5 | A { human: Human }, | ^ - -error: GraphQL union enum allows only unnamed variants with a single field, e.g. `Some(T)` - + | = note: https://spec.graphql.org/June2018/#sec-Unions +error: GraphQL union enum allows only unnamed variants with a single field, e.g. `Some(T)` --> fail/union/enum_wrong_variant_field.rs:10:6 | 10 | A(Human, u8), | ^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr index c5d3df1e..5c4d04e4 100644 --- a/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/union/struct_name_double_underscored.rs:5:8 | 5 | struct __Character; | ^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr b/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr index d7729954..c26a9da1 100644 --- a/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL union expects at least one union variant - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/struct_no_fields.rs:4:1 | 4 | struct Character; - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr index 96df4a97..57ed7c4c 100644 --- a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr @@ -1,12 +1,7 @@ error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/struct_non_object_variant.rs:9:10 - | -9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | -note: required by `juniper::GraphQLObject::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/union/struct_non_object_variant.rs:9:10 + | +9 | #[derive(GraphQLUnion)] + | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr b/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr index e3e3b806..87258824 100644 --- a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr @@ -1,20 +1,10 @@ error[E0277]: the trait bound `CustomContext: FromContext` is not satisfied - --> fail/union/trait_fail_infer_context.rs:3:1 - | -3 | #[graphql_union] - | ^^^^^^^^^^^^^^^^ expected an implementor of trait `FromContext` -4 | trait Character { - | _______- -5 | | fn a(&self, ctx: &SubContext) -> Option<&Human>; -6 | | fn b(&self, ctx: &CustomContext) -> Option<&Droid>; - | |________- required by a bound introduced by this call - | -note: required by `juniper::FromContext::from` - --> $WORKSPACE/juniper/src/executor/mod.rs - | - | fn from(value: &T) -> &Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/union/trait_fail_infer_context.rs:3:1 + | +3 | #[graphql_union] + | ^^^^^^^^^^^^^^^^ the trait `FromContext` is not implemented for `CustomContext` + | + = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> fail/union/trait_fail_infer_context.rs:3:1 diff --git a/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr b/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr index 197ba1b6..b81e5a67 100644 --- a/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr @@ -1,9 +1,8 @@ error: GraphQL union trait method `a` conflicts with the external resolver function `some_fn` declared on the trait to resolve the variant type `Human` - - = note: https://spec.graphql.org/June2018/#sec-Unions - = note: use `#[graphql(ignore)]` attribute to ignore this trait method for union variants resolution - --> fail/union/trait_method_conflicts_with_external_resolver_fn.rs:5:5 | 5 | fn a(&self) -> Option<&Human>; - | ^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions + = note: use `#[graphql(ignore)]` attribute to ignore this trait method for union variants resolution diff --git a/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr index 3faaa193..baf44bc8 100644 --- a/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr @@ -1,8 +1,7 @@ error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQL’s introspection system. - - = note: https://spec.graphql.org/June2018/#sec-Schema - --> fail/union/trait_name_double_underscored.rs:4:7 | 4 | trait __Character { | ^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Schema diff --git a/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr b/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr index 6bc9e423..b75d5ba6 100644 --- a/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr @@ -1,8 +1,7 @@ error: GraphQL union expects at least one union variant - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/trait_no_fields.rs:4:1 | 4 | trait Character {} - | ^^^^^ + | ^^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr index 5697644c..092bf452 100644 --- a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr @@ -1,12 +1,7 @@ error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/trait_non_object_variant.rs:9:1 - | -9 | #[graphql_union] - | ^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | -note: required by `juniper::GraphQLObject::mark` - --> $WORKSPACE/juniper/src/types/marker.rs - | - | fn mark() {} - | ^^^^^^^^^ - = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/union/trait_non_object_variant.rs:9:1 + | +9 | #[graphql_union] + | ^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr b/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr index 49098016..61e642b3 100644 --- a/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr @@ -1,8 +1,10 @@ error: GraphQL union must have a different type for each union variant - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/trait_same_type_pretty.rs:4:1 | -4 | trait Character { - | ^^^^^ +4 | / trait Character { +5 | | fn a(&self) -> Option<&u8>; +6 | | fn b(&self) -> Option<&u8>; +7 | | } + | |_^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr b/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr index e49387cd..2402ab17 100644 --- a/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr @@ -1,9 +1,8 @@ error: GraphQL union cannot use #[graphql(with = ...)] attribute on a trait method - - = note: https://spec.graphql.org/June2018/#sec-Unions - = note: instead use #[graphql(ignore)] on the method with #[graphql_union(on ... = ...)] on the trait itself - --> fail/union/trait_with_attr_on_method.rs:5:15 | 5 | #[graphql(with = something)] | ^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions + = note: instead use #[graphql(ignore)] on the method with #[graphql_union(on ... = ...)] on the trait itself diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr b/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr index f3209895..44d447c5 100644 --- a/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr @@ -1,8 +1,7 @@ error: GraphQL union expects trait method to accept `&self` only and, optionally, `&Context` - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/trait_wrong_method_input_args.rs:5:10 | 5 | fn a(&self, ctx: &(), rand: u8) -> Option<&Human>; - | ^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr b/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr index 9c0dd5b9..87ee8ff1 100644 --- a/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr @@ -1,8 +1,7 @@ error: GraphQL union expects trait method return type to be `Option<&VariantType>` only - - = note: https://spec.graphql.org/June2018/#sec-Unions - --> fail/union/trait_wrong_method_return_type.rs:5:20 | 5 | fn a(&self) -> &Human; - | ^ + | ^^^^^^ + | + = note: https://spec.graphql.org/June2018/#sec-Unions