Skip to content

Commit 5bbc73a

Browse files
authored
Redesign #[derive(ScalarValue)] macro to derive ScalarValue on enums (#1025)
1 parent 4862915 commit 5bbc73a

33 files changed

+894
-572
lines changed

integration_tests/codegen_fail/fail/interface/argument_wrong_default_array.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied
55
| ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`
66
|
77
= help: the following implementations were found:
8+
<&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>>
9+
<&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>>
10+
<&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>>
811
<[T; LANES] as From<Simd<T, LANES>>>
912
<[bool; LANES] as From<Mask<T, LANES>>>
1013
= note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]`

integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied
55
| ^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`
66
|
77
= help: the following implementations were found:
8+
<&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>>
9+
<&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>>
10+
<&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>>
811
<[T; LANES] as From<Simd<T, LANES>>>
912
<[bool; LANES] as From<Mask<T, LANES>>>
1013
= note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]`

integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_and_with.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar `with = <path>` attribute can\'t be combined with `transparent`. You can specify custom resolvers with `to_output`, `from_input`, `parse_token` attributes and still use `transparent` for unspecified ones.
1+
error: GraphQL scalar `with = <path>` attribute argument cannot be combined with `transparent`. You can specify custom resolvers with `to_output_with`, `from_input_with`, `parse_token`/`parse_token_with` attribute arguments and still use `transparent` for unspecified ones.
22
--> fail/scalar/derive_input/attr_transparent_and_with.rs:3:25
33
|
44
3 | #[graphql_scalar(with = Self, transparent)]

integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_named_fields.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar expected exactly 1 field, e.g., Test { test: i32 } because of `transparent` attribute
1+
error: GraphQL scalar `transparent` attribute argument requires exactly 1 field
22
--> fail/scalar/derive_input/attr_transparent_multiple_named_fields.rs:4:1
33
|
44
4 | / struct Scalar {

integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar expected exactly 1 field, e.g., Test(i32) because of `transparent` attribute
1+
error: GraphQL scalar `transparent` attribute argument requires exactly 1 field
22
--> fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.rs:4:1
33
|
44
4 | struct Scalar(i32, i32);

integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_unit_struct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar expected exactly 1 field, e.g.: `Test(i32)`, `Test { test: i32 }` because of `transparent` attribute
1+
error: GraphQL scalar `transparent` attribute argument requires exactly 1 field
22
--> fail/scalar/derive_input/attr_transparent_unit_struct.rs:4:1
33
|
44
4 | struct ScalarSpecifiedByUrl;

integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_and_with.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar `with = <path>` attribute can\'t be combined with `transparent`. You can specify custom resolvers with `to_output`, `from_input`, `parse_token` attributes and still use `transparent` for unspecified ones.
1+
error: GraphQL scalar `with = <path>` attribute argument cannot be combined with `transparent`. You can specify custom resolvers with `to_output_with`, `from_input_with`, `parse_token`/`parse_token_with` attribute arguments and still use `transparent` for unspecified ones.
22
--> fail/scalar/derive_input/derive_transparent_and_with.rs:4:18
33
|
44
4 | #[graphql(with = Self, transparent)]

integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_named_fields.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar expected exactly 1 field, e.g., Test { test: i32 } because of `transparent` attribute
1+
error: GraphQL scalar `transparent` attribute argument requires exactly 1 field
22
--> fail/scalar/derive_input/derive_transparent_multiple_named_fields.rs:4:1
33
|
44
4 | / #[graphql(transparent)]

integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar expected exactly 1 field, e.g., Test(i32) because of `transparent` attribute
1+
error: GraphQL scalar `transparent` attribute argument requires exactly 1 field
22
--> fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.rs:4:1
33
|
44
4 | / #[graphql(transparent)]

integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_unit_struct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: GraphQL scalar expected exactly 1 field, e.g.: `Test(i32)`, `Test { test: i32 }` because of `transparent` attribute
1+
error: GraphQL scalar `transparent` attribute argument requires exactly 1 field
22
--> fail/scalar/derive_input/derive_transparent_unit_struct.rs:4:1
33
|
44
4 | / #[graphql(transparent)]

0 commit comments

Comments
 (0)