@@ -28,11 +28,7 @@ function creatFileOrPatch(filePath, newFileData, encoding, config) {
2828 "server-input.mustache" ,
2929 "function-input.mustache" ,
3030 "index-src.mustache" ,
31- "tests.spec.mustache" ,
32- "webpack.config.mustache" ,
33- "webpack.config.layer.mustache" ,
34- "docker-entrypoint.mustache" ,
35- "Dockerfile.mustache"
31+ "tests.spec.mustache"
3632 ]
3733 if ( config . ignores ) {
3834 config . ignores . split ( ';' ) . forEach ( function ( ignore ) {
@@ -402,8 +398,17 @@ function mainProcessor(typeDefs, schema, projectInfo) {
402398 argv . verbose && console . log ( `* GraphQL Server: ${ server . Name } ...` )
403399 let dataSources = rootObject . DataSources . filter ( ds => ds . Definition . includes ( server . Definition ) )
404400 dataSources = transformer . convertToArrayWithNotation ( dataSources )
401+ let serverFunctions = [ ]
402+ rootObject . Functions . map ( f => {
403+ if ( f . Servers . find ( s => {
404+ return s . ServerName == server . Name
405+ } ) ) {
406+ serverFunctions . push ( f )
407+ }
408+ } )
409+ serverFunctions = transformer . convertToArrayWithNotation ( serverFunctions )
405410 gqlConfig . GraphQLServers . map ( cfg => {
406- writeTemplateFile ( `${ templates } /${ cfg . input } ` , { ...projectInfo , ...server , ServerName : server . Name , Functions : rootObject . Functions , DataSources : dataSources , GRAPHQL_USER_DEFINITIONS : schema } , outputDir , cfg . output , projectInfo . WriteConfig )
411+ writeTemplateFile ( `${ templates } /${ cfg . input } ` , { ...projectInfo , ...server , ServerName : server . Name , Functions : serverFunctions , DataSources : dataSources , GRAPHQL_USER_DEFINITIONS : schema } , outputDir , cfg . output , projectInfo . WriteConfig )
407412 } )
408413 rootObject . DataObjects . map ( data => {
409414 argv . verbose && console . log ( ` Data Object: ${ data . Name } ...` )
0 commit comments