@@ -38,19 +38,17 @@ private static void DiscoverDirectives(SchemaDefinition schema, DocumentNode doc
38
38
{
39
39
if ( definition is DirectiveDefinitionNode def )
40
40
{
41
- if ( BuiltIns . IsBuiltInDirective ( def . Name . Value ) )
42
- {
43
- // If a built-in directive is redefined in the schema, we just ignore it.
44
- continue ;
45
- }
46
-
47
41
if ( schema . DirectiveDefinitions . ContainsName ( def . Name . Value ) )
48
42
{
49
43
// TODO : parsing error
50
44
throw new Exception ( "duplicate" ) ;
51
45
}
52
46
53
- schema . DirectiveDefinitions . Add ( new DirectiveDefinition ( def . Name . Value ) ) ;
47
+ schema . DirectiveDefinitions . Add (
48
+ new DirectiveDefinition ( def . Name . Value )
49
+ {
50
+ IsSpecDirective = BuiltIns . IsBuiltInDirective ( def . Name . Value )
51
+ } ) ;
54
52
}
55
53
}
56
54
}
@@ -61,11 +59,6 @@ private static void DiscoverTypes(SchemaDefinition schema, DocumentNode document
61
59
{
62
60
if ( definition is ITypeDefinitionNode typeDef )
63
61
{
64
- if ( BuiltIns . IsBuiltInScalar ( typeDef . Name . Value ) )
65
- {
66
- continue ;
67
- }
68
-
69
62
if ( schema . Types . ContainsName ( typeDef . Name . Value ) )
70
63
{
71
64
// TODO : parsing error
@@ -91,7 +84,11 @@ private static void DiscoverTypes(SchemaDefinition schema, DocumentNode document
91
84
break ;
92
85
93
86
case ScalarTypeDefinitionNode :
94
- schema . Types . Add ( new ScalarTypeDefinition ( typeDef . Name . Value ) ) ;
87
+ schema . Types . Add (
88
+ new ScalarTypeDefinition ( typeDef . Name . Value )
89
+ {
90
+ IsSpecScalar = BuiltIns . IsBuiltInScalar ( typeDef . Name . Value )
91
+ } ) ;
95
92
break ;
96
93
97
94
case UnionTypeDefinitionNode :
@@ -196,11 +193,6 @@ private static void BuildTypes(SchemaDefinition schema, DocumentNode document)
196
193
break ;
197
194
198
195
case ScalarTypeDefinitionNode typeDef :
199
- if ( BuiltIns . IsBuiltInScalar ( typeDef . Name . Value ) )
200
- {
201
- continue ;
202
- }
203
-
204
196
BuildScalarType (
205
197
schema ,
206
198
( ScalarTypeDefinition ) schema . Types [ typeDef . Name . Value ] ,
@@ -545,11 +537,6 @@ private static void BuildDirectiveTypes(SchemaDefinition schema, DocumentNode do
545
537
{
546
538
if ( definition is DirectiveDefinitionNode directiveDef )
547
539
{
548
- if ( BuiltIns . IsBuiltInDirective ( directiveDef . Name . Value ) )
549
- {
550
- continue ;
551
- }
552
-
553
540
BuildDirectiveType (
554
541
schema ,
555
542
schema . DirectiveDefinitions [ directiveDef . Name . Value ] ,
0 commit comments