File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
modules/module-core/src/utils Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,20 @@ export const buildSchema =
20
20
authDirectiveTypeDefs : string ;
21
21
authDirectiveTransformer : ( schema : GraphQLSchema ) => GraphQLSchema ;
22
22
} ;
23
- directives ?: Array < [ TypeSource , ( schema : GraphQLSchema ) => GraphQLSchema ] > ;
23
+ directives ?: Array < [ TypeSource | undefined , ( schema : GraphQLSchema ) => GraphQLSchema ] > ;
24
24
} = { } ) : ApplicationConfig [ 'schemaBuilder' ] =>
25
25
( { typeDefs : accountsTypeDefs , resolvers : accountsResolvers } ) => {
26
26
let schema = makeExecutableSchema ( {
27
27
typeDefs : mergeTypeDefs ( [
28
28
...accountsTypeDefs ,
29
29
...( typeDefs ? [ typeDefs ] : [ ] ) ,
30
30
authDirectiveTypeDefs ,
31
- ...directives . map ( ( [ directiveTypeDefs ] ) => directiveTypeDefs ) ,
31
+ ...directives . reduce < TypeSource [ ] > ( ( acc , [ directiveTypeDefs ] ) => {
32
+ if ( directiveTypeDefs != null ) {
33
+ acc . push ( directiveTypeDefs ) ;
34
+ }
35
+ return acc ;
36
+ } , [ ] ) ,
32
37
] ) ,
33
38
resolvers : resolvers
34
39
? mergeResolvers ( [ resolvers , ...accountsResolvers ] as Maybe <
You can’t perform that action at this time.
0 commit comments