File tree 2 files changed +8
-8
lines changed
test/unit/should_consolidate_input_and_output_types 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,13 @@ function typesAreEquivalent(
71
71
const matchingInputField = inputNode . astNode ?. fields ?. find (
72
72
( inputField ) => inputField . name . value === typeField . name . value ,
73
73
) ;
74
- if ( ! matchingInputField ?. type ) return false ;
74
+ if (
75
+ ! matchingInputField ?. type ||
76
+ typeField . type . kind !== matchingInputField . type . kind
77
+ ) {
78
+ return false ;
79
+ }
80
+
75
81
const baseTypeName = getBaseTypeNode ( typeField . type ) . name . value ;
76
82
const baseInputTypeName = getBaseTypeNode ( matchingInputField . type ) . name
77
83
. value ;
Original file line number Diff line number Diff line change @@ -136,15 +136,9 @@ data class MyNullabilityType(
136
136
137
137
@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations .Locations .INPUT_OBJECT ])
138
138
data class MyNullabilityTypeInput (
139
- val field1 : MyNestedNullabilityTypeInput
139
+ val field1 : MyNestedNullabilityType ? = null
140
140
)
141
141
142
- @GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations .Locations .OBJECT ])
143
142
data class MyNestedNullabilityType (
144
143
val field2 : String
145
144
)
146
-
147
- @GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations .Locations .INPUT_OBJECT ])
148
- data class MyNestedNullabilityTypeInput (
149
- val field2 : String
150
- )
You can’t perform that action at this time.
0 commit comments