File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
src/HotChocolate/Fusion-vnext
test/Fusion.Composition.Tests Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1+ using static HotChocolate . Fusion . WellKnownTypeNames ;
2+
3+ namespace HotChocolate . Fusion ;
4+
5+ internal static class FusionBuiltIns
6+ {
7+ public static bool IsBuiltInSourceSchemaScalar ( string typeName )
8+ {
9+ return typeName switch
10+ {
11+ FieldSelectionMap or FieldSelectionSet => true ,
12+ _ => false
13+ } ;
14+ }
15+ }
Original file line number Diff line number Diff line change @@ -574,12 +574,19 @@ .. typeGroup.Where(
574574 /// <seealso href="https://graphql.github.io/composite-schemas-spec/draft/#sec-Merge-Scalar-Types">
575575 /// Specification
576576 /// </seealso>
577- private MutableScalarTypeDefinition MergeScalarTypes (
577+ private MutableScalarTypeDefinition ? MergeScalarTypes (
578578 ImmutableArray < TypeInfo > typeGroup ,
579579 MutableSchemaDefinition mergedSchema )
580580 {
581581 var firstScalar = typeGroup [ 0 ] . Type ;
582582 var typeName = firstScalar . Name ;
583+
584+ // Built-in Fusion scalar types should not be merged.
585+ if ( FusionBuiltIns . IsBuiltInSourceSchemaScalar ( typeName ) )
586+ {
587+ return null ;
588+ }
589+
583590 var description = firstScalar . Description ;
584591 var scalarType = GetOrCreateType < MutableScalarTypeDefinition > ( mergedSchema , typeName ) ;
585592
Original file line number Diff line number Diff line change @@ -107,6 +107,17 @@ scalar Date
107107 @fusion__type(schema: A)
108108 @fusion__type(schema: B)
109109 """
110+ } ,
111+ // Built-in Fusion scalar types should not be merged (FieldSelectionSet/Map).
112+ {
113+ [
114+ """
115+ # Schema A
116+ directive @provides(fields: FieldSelectionSet!) on FIELD_DEFINITION
117+ directive @require(field: FieldSelectionMap!) on ARGUMENT_DEFINITION
118+ """
119+ ] ,
120+ ""
110121 }
111122 } ;
112123 }
You can’t perform that action at this time.
0 commit comments