File tree Expand file tree Collapse file tree 4 files changed +55
-1
lines changed
src/Types/Types/Descriptors/Definitions
Types.Tests.Documentation
Types.Tests/Types/Descriptors/Definitions Expand file tree Collapse file tree 4 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ protected void MergeInto(DefinitionBase target)
199
199
}
200
200
}
201
201
202
- if ( Description is not null )
202
+ if ( target . Description is null && Description is not null )
203
203
{
204
204
target . Description = Description ;
205
205
}
Original file line number Diff line number Diff line change
1
+ namespace HotChocolate . Types . Descriptors ;
2
+
3
+ /// <summary>
4
+ /// QueryExtWithDocs1
5
+ /// </summary>
6
+ [ QueryType ]
7
+ public static class QueryExtWithDocs1
8
+ {
9
+ public static int GetFoo1 ( ) => 1 ;
10
+ }
Original file line number Diff line number Diff line change
1
+ namespace HotChocolate . Types . Descriptors ;
2
+
3
+ /// <summary>
4
+ /// QueryExtWithDocs2
5
+ /// </summary>
6
+ [ QueryType ]
7
+ public static class QueryExtWithDocs2
8
+ {
9
+ public static int GetFoo2 ( ) => 1 ;
10
+ }
Original file line number Diff line number Diff line change
1
+ using CookieCrumble ;
2
+ using HotChocolate . Execution ;
3
+ using Microsoft . Extensions . DependencyInjection ;
4
+
5
+ namespace HotChocolate . Types . Descriptors . Definitions ;
6
+
7
+ public class DefinitionBaseTests
8
+ {
9
+ [ Fact ]
10
+ public async Task MergeInto_MultipleTypeExtensionXmlDescriptions_UsesQueryTypeDescription ( )
11
+ {
12
+ // arrange & act
13
+ var schema = await new ServiceCollection ( )
14
+ . AddGraphQL ( )
15
+ . AddQueryType ( d => d . Description ( "Query" ) )
16
+ . AddTypeExtension ( typeof ( QueryExtWithDocs1 ) )
17
+ . AddTypeExtension ( typeof ( QueryExtWithDocs2 ) )
18
+ . BuildSchemaAsync ( ) ;
19
+
20
+ // assert
21
+ schema . MatchInlineSnapshot (
22
+ """
23
+ schema {
24
+ query: Query
25
+ }
26
+
27
+ "Query"
28
+ type Query {
29
+ foo1: Int!
30
+ foo2: Int!
31
+ }
32
+ """ ) ;
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments