File tree 3 files changed +10
-1
lines changed
test/unit/should_annotate_types_properly
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ export function buildDirectiveAnnotations(
39
39
deprecatedReasonNode ?. kind === "StringValue"
40
40
? deprecatedReasonNode . value
41
41
: "" ;
42
+ if ( incomingNode . description ?. value && resolvedType ?. unionAnnotation ) {
43
+ return "" ;
44
+ }
42
45
const descriptionAnnotator = resolvedType ?. unionAnnotation
43
46
? "@GraphQLDescription"
44
47
: "@Deprecated" ;
Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ data class MyType(
22
22
val deprecated5 : Any? = null ,
23
23
@MyUnion
24
24
@GraphQLDescription(" It uses the GraphQLDescription annotation for union types" )
25
- val deprecated6 : Any? = null
25
+ val deprecated6 : Any? = null ,
26
+ @MyUnion
27
+ @GraphQLDescription(" When there is a description" )
28
+ val deprecated7 : Any? = null
26
29
)
27
30
28
31
@GraphQLUnion(
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ type MyType {
24
24
@deprecated (
25
25
reason : " It uses the GraphQLDescription annotation for union types"
26
26
)
27
+ "When there is a description"
28
+ deprecated7 : MyUnion
29
+ @deprecated (reason : " It omits the @Deprecated annotation for now" )
27
30
}
28
31
29
32
union MyUnion = MyType
You can’t perform that action at this time.
0 commit comments