@@ -179,7 +179,7 @@ export function extendSchema(
179
179
...operationTypes ,
180
180
types : objectValues ( typeMap ) ,
181
181
directives : [
182
- ...replaceDirectives ( schemaConfig . directives ) ,
182
+ ...schemaConfig . directives . map ( replaceDirective ) ,
183
183
...astBuilder . buildDirectives ( directiveDefs ) ,
184
184
] ,
185
185
astNode : schemaDef || schemaConfig . astNode ,
@@ -208,17 +208,11 @@ export function extendSchema(
208
208
return ( ( typeMap [ type . name ] : any ) : T ) ;
209
209
}
210
210
211
- function replaceDirectives(
212
- directives: $ReadOnlyArray< GraphQLDirective > ,
213
- ): Array< GraphQLDirective > {
214
- devAssert ( directives , 'schema must have default directives.' ) ;
215
-
216
- return directives . map ( directive => {
217
- const config = directive . toConfig ( ) ;
218
- return new GraphQLDirective ( {
219
- ...config ,
220
- args : mapValue ( config . args , extendArg ) ,
221
- } ) ;
211
+ function replaceDirective(directive: GraphQLDirective): GraphQLDirective {
212
+ const config = directive . toConfig ( ) ;
213
+ return new GraphQLDirective ( {
214
+ ...config ,
215
+ args : mapValue ( config . args , extendArg ) ,
222
216
} ) ;
223
217
}
224
218
0 commit comments