Skip to content

Fix juniper_codegen_tests #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
|
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -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
13 changes: 6 additions & 7 deletions integration_tests/codegen_fail/fail/interface/no_fields.stderr
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Loading