File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
src/HotChocolate/Fusion-vnext
test/Fusion.Composition.Tests Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -560,13 +560,7 @@ private ScalarTypeDefinition MergeScalarTypes(ImmutableArray<TypeInfo> typeGroup
560
560
. Where ( i => ! i . MemberType . HasInternalDirective ( ) )
561
561
. GroupBy ( i => i . MemberType . Name )
562
562
// Intersection: Member type definition count matches union type definition count.
563
- . Where ( g => g . Count ( ) == typeGroup . Length )
564
- . ToImmutableArray ( ) ;
565
-
566
- if ( unionMemberGroupByName . Length == 0 )
567
- {
568
- return null ;
569
- }
563
+ . Where ( g => g . Count ( ) == typeGroup . Length ) ;
570
564
571
565
var unionType = new UnionTypeDefinition ( name ) { Description = description } ;
572
566
Original file line number Diff line number Diff line change @@ -143,10 +143,9 @@ union SearchResult
143
143
"""
144
144
} ,
145
145
// Each union's possible types are considered in turn. Only those that are not marked
146
- // @internal are included in the final composed union. This preserves the valid types
147
- // from all sources while systematically filtering out anything intended for internal
148
- // use only. In case there are no possible types left after filtering, the merged union
149
- // is considered @internal and cannot appear in the final schema.
146
+ // @internal or @inaccessible are included in the final composed union. This preserves
147
+ // the valid types from all sources while systematically filtering out anything
148
+ // inaccessible or intended for internal use only.
150
149
{
151
150
[
152
151
"""
@@ -162,7 +161,11 @@ union SearchResult
162
161
type User @internal { id: ID! }
163
162
"""
164
163
] ,
165
- ""
164
+ """
165
+ union SearchResult
166
+ @fusion__type(schema: A)
167
+ @fusion__type(schema: B) =
168
+ """
166
169
} ,
167
170
// Union member type "User" internal in one of two schemas. No remaining member types.
168
171
{
@@ -186,6 +189,10 @@ type User
186
189
id: ID!
187
190
@fusion__field(schema: A)
188
191
}
192
+
193
+ union SearchResult
194
+ @fusion__type(schema: A)
195
+ @fusion__type(schema: B) =
189
196
"""
190
197
} ,
191
198
// Union member type "Order" internal in one of two schemas, "Product" visible in both.
You can’t perform that action at this time.
0 commit comments