@@ -162,13 +162,14 @@ private static InputFieldDefinition MergeArguments(
162
162
mergedArgument . Type = mergedArgument . Type . ReplaceNameType (
163
163
_ => GetOrCreateType ( mergedSchema , mergedArgument . Type ) ) ;
164
164
165
+ AddFusionInputFieldDirectives ( mergedArgument , argumentGroup ) ;
166
+
165
167
if ( argumentGroup . Any ( i => i . Argument . HasInaccessibleDirective ( ) ) )
166
168
{
167
- mergedArgument . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
169
+ mergedArgument . Directives . Add (
170
+ new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
168
171
}
169
172
170
- AddFusionInputFieldDirectives ( mergedArgument , argumentGroup ) ;
171
-
172
173
return mergedArgument ;
173
174
}
174
175
@@ -195,13 +196,13 @@ private EnumTypeDefinition MergeEnumTypes(
195
196
196
197
enumType . Description = description ;
197
198
199
+ AddFusionTypeDirectives ( enumType , typeGroup ) ;
200
+
198
201
if ( typeGroup . Any ( i => i . Type . HasInaccessibleDirective ( ) ) )
199
202
{
200
- enumType . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
203
+ enumType . Directives . Add ( new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
201
204
}
202
205
203
- AddFusionTypeDirectives ( enumType , typeGroup ) ;
204
-
205
206
// [EnumValueName: [{EnumValue, EnumType, Schema}, ...], ...].
206
207
var enumValueGroupByName = typeGroup
207
208
. SelectMany (
@@ -235,13 +236,13 @@ private EnumValue MergeEnumValues(ImmutableArray<EnumValueInfo> enumValueGroup)
235
236
236
237
var enumValue = new EnumValue ( valueName ) { Description = description } ;
237
238
239
+ AddFusionEnumValueDirectives ( enumValue , enumValueGroup ) ;
240
+
238
241
if ( enumValueGroup . Any ( i => i . EnumValue . HasInaccessibleDirective ( ) ) )
239
242
{
240
- enumValue . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
243
+ enumValue . Directives . Add ( new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
241
244
}
242
245
243
- AddFusionEnumValueDirectives ( enumValue , enumValueGroup ) ;
244
-
245
246
return enumValue ;
246
247
}
247
248
@@ -269,13 +270,14 @@ private InputObjectTypeDefinition MergeInputTypes(
269
270
270
271
inputObjectType . Description = description ;
271
272
273
+ AddFusionTypeDirectives ( inputObjectType , typeGroup ) ;
274
+
272
275
if ( typeGroup . Any ( i => i . Type . HasInaccessibleDirective ( ) ) )
273
276
{
274
- inputObjectType . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
277
+ inputObjectType . Directives . Add (
278
+ new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
275
279
}
276
280
277
- AddFusionTypeDirectives ( inputObjectType , typeGroup ) ;
278
-
279
281
// [FieldName: [{Field, Type, Schema}, ...], ...].
280
282
var fieldGroupByName = typeGroup
281
283
. SelectMany (
@@ -326,13 +328,13 @@ private InputFieldDefinition MergeInputFields(
326
328
Type = fieldType . ReplaceNameType ( _ => GetOrCreateType ( mergedSchema , fieldType ) )
327
329
} ;
328
330
331
+ AddFusionInputFieldDirectives ( inputField , inputFieldGroup ) ;
332
+
329
333
if ( inputFieldGroup . Any ( i => i . Field . HasInaccessibleDirective ( ) ) )
330
334
{
331
- inputField . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
335
+ inputField . Directives . Add ( new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
332
336
}
333
337
334
- AddFusionInputFieldDirectives ( inputField , inputFieldGroup ) ;
335
-
336
338
return inputField ;
337
339
}
338
340
@@ -374,14 +376,15 @@ private InterfaceTypeDefinition MergeInterfaceTypes(
374
376
GetOrCreateType < InterfaceTypeDefinition > ( mergedSchema , interfaceName ) ) ;
375
377
}
376
378
379
+ AddFusionTypeDirectives ( interfaceType , typeGroup ) ;
380
+ AddFusionImplementsDirectives ( interfaceType , [ .. interfaceGroupByName . SelectMany ( g => g ) ] ) ;
381
+
377
382
if ( typeGroup . Any ( i => i . Type . HasInaccessibleDirective ( ) ) )
378
383
{
379
- interfaceType . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
384
+ interfaceType . Directives . Add (
385
+ new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
380
386
}
381
387
382
- AddFusionTypeDirectives ( interfaceType , typeGroup ) ;
383
- AddFusionImplementsDirectives ( interfaceType , [ .. interfaceGroupByName . SelectMany ( g => g ) ] ) ;
384
-
385
388
// [FieldName: [{Field, Type, Schema}, ...], ...].
386
389
var fieldGroupByName = typeGroup
387
390
. SelectMany (
@@ -449,14 +452,14 @@ private InterfaceTypeDefinition MergeInterfaceTypes(
449
452
GetOrCreateType < InterfaceTypeDefinition > ( mergedSchema , interfaceName ) ) ;
450
453
}
451
454
455
+ AddFusionTypeDirectives ( objectType , typeGroup ) ;
456
+ AddFusionImplementsDirectives ( objectType , [ .. interfaceGroupByName . SelectMany ( g => g ) ] ) ;
457
+
452
458
if ( typeGroup . Any ( i => i . Type . HasInaccessibleDirective ( ) ) )
453
459
{
454
- objectType . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
460
+ objectType . Directives . Add ( new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
455
461
}
456
462
457
- AddFusionTypeDirectives ( objectType , typeGroup ) ;
458
- AddFusionImplementsDirectives ( objectType , [ .. interfaceGroupByName . SelectMany ( g => g ) ] ) ;
459
-
460
463
// [FieldName: [{Field, Type, Schema}, ...], ...].
461
464
var fieldGroupByName = typeGroup
462
465
. SelectMany (
@@ -536,14 +539,14 @@ private InterfaceTypeDefinition MergeInterfaceTypes(
536
539
}
537
540
}
538
541
542
+ AddFusionFieldDirectives ( outputField , fieldGroup ) ;
543
+ AddFusionRequiresDirectives ( outputField , fieldGroup ) ;
544
+
539
545
if ( fieldGroup . Any ( i => i . Field . HasInaccessibleDirective ( ) ) )
540
546
{
541
- outputField . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
547
+ outputField . Directives . Add ( new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
542
548
}
543
549
544
- AddFusionFieldDirectives ( outputField , fieldGroup ) ;
545
- AddFusionRequiresDirectives ( outputField , fieldGroup ) ;
546
-
547
550
return outputField ;
548
551
}
549
552
@@ -571,13 +574,13 @@ private ScalarTypeDefinition MergeScalarTypes(
571
574
572
575
scalarType . Description = description ;
573
576
577
+ AddFusionTypeDirectives ( scalarType , typeGroup ) ;
578
+
574
579
if ( typeGroup . Any ( i => i . Type . HasInaccessibleDirective ( ) ) )
575
580
{
576
- scalarType . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
581
+ scalarType . Directives . Add ( new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
577
582
}
578
583
579
- AddFusionTypeDirectives ( scalarType , typeGroup ) ;
580
-
581
584
return scalarType ;
582
585
}
583
586
@@ -604,11 +607,6 @@ private UnionTypeDefinition MergeUnionTypes(
604
607
605
608
unionType . Description = description ;
606
609
607
- if ( typeGroup . Any ( i => i . Type . HasInaccessibleDirective ( ) ) )
608
- {
609
- unionType . Directives . Add ( new Directive ( new InaccessibleDirectiveDefinition ( ) ) ) ;
610
- }
611
-
612
610
AddFusionTypeDirectives ( unionType , typeGroup ) ;
613
611
614
612
// [UnionMemberName: [{MemberType, UnionType, Schema}, ...], ...].
@@ -628,6 +626,11 @@ private UnionTypeDefinition MergeUnionTypes(
628
626
unionType . Types . Add ( GetOrCreateType < ObjectTypeDefinition > ( mergedSchema , memberName ) ) ;
629
627
}
630
628
629
+ if ( typeGroup . Any ( i => i . Type . HasInaccessibleDirective ( ) ) )
630
+ {
631
+ unionType . Directives . Add ( new Directive ( new FusionInaccessibleDirectiveDefinition ( ) ) ) ;
632
+ }
633
+
631
634
return unionType ;
632
635
}
633
636
0 commit comments