From 4f83f53a57c7c0ca5d47c311106d8ca2acdd414f Mon Sep 17 00:00:00 2001
From: ilslv <ilya.solovyiov@gmail.com>
Date: Mon, 20 Dec 2021 15:05:05 +0300
Subject: [PATCH 1/3] Fix codegen tests

---
 .../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 +-
 .../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 ++-
 57 files changed, 280 insertions(+), 342 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 8c7fc3604..637156392 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 6c4e0ed60..fd21efcca 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<S> + FromInputValue<S>,
+     |                             ^^^^^^^^^^^^^^^^^ 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<S>) -> Result<Self, Self::Error>;
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-    = 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 edb0aa99e..9362b428c 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 08e367306..86a6a9b28 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 019df45d4..066fdbe63 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 b36017e02..0c47e6158 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 44ae096b8..8b87b4023 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<S> + FromInputValue<S>,
+     |                             ^^^^^^^^^^^^^^^^^ 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 1b7e861c7..0b149ee54 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<Simd<T, LANES>>>
+             <[bool; LANES] as From<Mask<T, LANES>>>
    = 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 ce90439b4..1aede59e0 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 543c8cfff..ee9e48343 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 164c78ccf..22aa7aba2 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 fdd492f50..2cdfafa6d 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 19f45f691..1491540eb 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 ff07dbcbb..284a3e1d5 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 d3c55953a..35c2dd0ca 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 ba46779fc..2cc6aa61c 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 3d2e4d371..ddab0d4cc 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 f93a398fc..6ee3a756a 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 976f8e089..44e21e0a1 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<S> + FromInputValue<S>,
+     |                             ^^^^^^^^^^^^^^^^^ 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 83128b5c8..27332cfeb 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<Simd<T, LANES>>>
+            <[bool; LANES] as From<Mask<T, LANES>>>
   = 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 4339c20ef..088f406e6 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 f22b6155d..3c6968b2a 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 323003ab7..031654a20 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 35a77ead6..9ba0098bc 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 09be8d8e2..6a6e64036 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 0a24fe8e9..2a661f4c0 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 3615a35ca..18c084239 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 eb9dfb6cf..809f72977 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 96038236f..ef198b790 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 71b8d0e58..5fc072a0a 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/subscription/argument_double_underscored.stderr b/integration_tests/codegen_fail/fail/subscription/argument_double_underscored.stderr
index 7cc24a2d3..fd3737038 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 59f35de39..45c72bce6 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<S> + FromInputValue<S>,
+     |                             ^^^^^^^^^^^^^^^^^ 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 56b033cbb..4d71e80d9 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<Simd<T, LANES>>>
+             <[bool; LANES] as From<Mask<T, LANES>>>
    = 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 a4adbdd62..090a3123a 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 344b56735..c20611795 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 733dd6dda..34773a156 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 b93010eac..4752ecb0d 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 8bb828020..90d4eb11d 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 85b57e2c9..379a5d690 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 c0f378c36..9d913d22f 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 f952d0f83..be6d0e292 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 4d7d4f07b..9ab9c4005 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 ccfb6325d..f0f17fbca 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 8a6988bf5..8c432f3ec 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 26497520d..f9d00963d 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 c5d3df1e4..5c4d04e4d 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 d77299544..c26a9da1e 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 96df4a97f..57ed7c4c0 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 e3e3b8065..87258824d 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<SubContext>` is not satisfied
-   --> fail/union/trait_fail_infer_context.rs:3:1
-    |
-3   |   #[graphql_union]
-    |   ^^^^^^^^^^^^^^^^ expected an implementor of trait `FromContext<SubContext>`
-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<SubContext>` 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 197ba1b65..b81e5a670 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 3faaa193e..baf44bc85 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 6bc9e4234..b75d5ba6e 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 5697644cc..092bf452f 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 490980167..61e642b34 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 e49387cd0..2402ab17b 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 f32098957..44d447c5e 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 9c0dd5b95..87ee8ff1e 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

From 84350bfb0f48b02ce640f4afa188967c0893c138 Mon Sep 17 00:00:00 2001
From: ilslv <ilya.solovyiov@gmail.com>
Date: Mon, 20 Dec 2021 15:15:06 +0300
Subject: [PATCH 2/3] Fix codegen tests

---
 .../codegen_fail/fail/scalar/impl_invalid_url.stderr            | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 bb2aeaeeb..999a04b6b 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")]
   |                  ^^^^^^^^^^^^^^^^

From e6b2e57db879711e9fd782fb051992090fb028dc Mon Sep 17 00:00:00 2001
From: ilslv <ilya.solovyiov@gmail.com>
Date: Mon, 20 Dec 2021 15:49:44 +0300
Subject: [PATCH 3/3] Add `@deprecated` directive

---
 juniper/src/schema/model.rs               | 25 ++++++++
 juniper/src/tests/introspection_tests.rs  |  7 +++
 juniper/src/tests/schema_introspection.rs | 70 +++++++++++++++++++++++
 3 files changed, 102 insertions(+)

diff --git a/juniper/src/schema/model.rs b/juniper/src/schema/model.rs
index cc48f592e..39990d1fd 100644
--- a/juniper/src/schema/model.rs
+++ b/juniper/src/schema/model.rs
@@ -85,10 +85,14 @@ pub enum DirectiveLocation {
     Scalar,
     #[graphql(name = "FRAGMENT_DEFINITION")]
     FragmentDefinition,
+    #[graphql(name = "FIELD_DEFINITION")]
+    FieldDefinition,
     #[graphql(name = "FRAGMENT_SPREAD")]
     FragmentSpread,
     #[graphql(name = "INLINE_FRAGMENT")]
     InlineFragment,
+    #[graphql(name = "ENUM_VALUE")]
+    EnumValue,
 }
 
 impl<'a, QueryT, MutationT, SubscriptionT>
@@ -214,6 +218,10 @@ impl<'a, S> SchemaType<'a, S> {
             "include".to_owned(),
             DirectiveType::new_include(&mut registry),
         );
+        directives.insert(
+            "deprecated".to_owned(),
+            DirectiveType::new_deprecated(&mut registry),
+        );
         directives.insert(
             "specifiedBy".to_owned(),
             DirectiveType::new_specified_by(&mut registry),
@@ -545,6 +553,21 @@ where
         )
     }
 
+    fn new_deprecated(registry: &mut Registry<'a, S>) -> DirectiveType<'a, S>
+    where
+        S: ScalarValue,
+    {
+        Self::new(
+            "deprecated",
+            &[
+                DirectiveLocation::FieldDefinition,
+                DirectiveLocation::EnumValue,
+            ],
+            &[registry.arg::<String>("reason", &())],
+            false,
+        )
+    }
+
     fn new_specified_by(registry: &mut Registry<'a, S>) -> DirectiveType<'a, S>
     where
         S: ScalarValue,
@@ -570,10 +593,12 @@ impl fmt::Display for DirectiveLocation {
             DirectiveLocation::Mutation => "mutation",
             DirectiveLocation::Subscription => "subscription",
             DirectiveLocation::Field => "field",
+            DirectiveLocation::FieldDefinition => "field definition",
             DirectiveLocation::FragmentDefinition => "fragment definition",
             DirectiveLocation::FragmentSpread => "fragment spread",
             DirectiveLocation::InlineFragment => "inline fragment",
             DirectiveLocation::Scalar => "scalar",
+            DirectiveLocation::EnumValue => "enum value",
         })
     }
 }
diff --git a/juniper/src/tests/introspection_tests.rs b/juniper/src/tests/introspection_tests.rs
index 16416b2f5..f4f064914 100644
--- a/juniper/src/tests/introspection_tests.rs
+++ b/juniper/src/tests/introspection_tests.rs
@@ -208,6 +208,13 @@ async fn test_introspection_directives() {
                         "INLINE_FRAGMENT",
                     ],
                 },
+                {
+                    "name": "deprecated",
+                    "locations": [
+                        "FIELD_DEFINITION",
+                        "ENUM_VALUE",
+                    ],
+                },
                 {
                     "name": "specifiedBy",
                     "locations": [
diff --git a/juniper/src/tests/schema_introspection.rs b/juniper/src/tests/schema_introspection.rs
index fbea3b987..d71b8dc88 100644
--- a/juniper/src/tests/schema_introspection.rs
+++ b/juniper/src/tests/schema_introspection.rs
@@ -1050,6 +1050,12 @@ pub(crate) fn schema_introspection_result() -> Value {
                   "isDeprecated": false,
                   "deprecationReason": null
                 },
+                {
+                  "name": "FIELD_DEFINITION",
+                  "description": null,
+                  "isDeprecated": false,
+                  "deprecationReason": null
+                },
                 {
                   "name": "FRAGMENT_SPREAD",
                   "description": null,
@@ -1067,6 +1073,12 @@ pub(crate) fn schema_introspection_result() -> Value {
                   "description": null,
                   "isDeprecated": false,
                   "deprecationReason": null
+                },
+                {
+                  "name": "ENUM_VALUE",
+                  "description": null,
+                  "isDeprecated": false,
+                  "deprecationReason": null
                 }
               ],
               "possibleTypes": null
@@ -1376,6 +1388,31 @@ pub(crate) fn schema_introspection_result() -> Value {
                 }
               ]
             },
+            {
+              "name": "deprecated",
+              "description": null,
+              "isRepeatable": false,
+              "locations": [
+                "FIELD_DEFINITION",
+                "ENUM_VALUE"
+              ],
+              "args": [
+                {
+                  "name": "reason",
+                  "description": null,
+                  "type": {
+                    "kind": "NON_NULL",
+                    "name": null,
+                    "ofType": {
+                      "kind": "SCALAR",
+                      "name": "String",
+                      "ofType": null
+                    }
+                  },
+                  "defaultValue": null
+                }
+              ]
+            },
             {
               "name": "specifiedBy",
               "description": null,
@@ -2345,6 +2382,11 @@ pub(crate) fn schema_introspection_result_without_descriptions() -> Value {
                   "isDeprecated": false,
                   "deprecationReason": null
                 },
+                {
+                  "name": "FIELD_DEFINITION",
+                  "isDeprecated": false,
+                  "deprecationReason": null
+                },
                 {
                   "name": "FRAGMENT_SPREAD",
                   "isDeprecated": false,
@@ -2359,6 +2401,11 @@ pub(crate) fn schema_introspection_result_without_descriptions() -> Value {
                   "name": "SCALAR",
                   "isDeprecated": false,
                   "deprecationReason": null
+                },
+                {
+                  "name": "ENUM_VALUE",
+                  "isDeprecated": false,
+                  "deprecationReason": null
                 }
               ],
               "possibleTypes": null
@@ -2650,6 +2697,29 @@ pub(crate) fn schema_introspection_result_without_descriptions() -> Value {
                 }
               ]
             },
+            {
+              "name": "deprecated",
+              "isRepeatable": false,
+              "locations": [
+                "FIELD_DEFINITION",
+                "ENUM_VALUE"
+              ],
+              "args": [
+                {
+                  "name": "reason",
+                  "type": {
+                    "kind": "NON_NULL",
+                    "name": null,
+                    "ofType": {
+                      "kind": "SCALAR",
+                      "name": "String",
+                      "ofType": null
+                    }
+                  },
+                  "defaultValue": null
+                }
+              ]
+            },
             {
               "name": "specifiedBy",
               "isRepeatable": false,
