Skip to content

Commit c436ec9

Browse files
authored
stop previous apolloServer before creating a new one
This causes socket listeners to close gracefully. Fixes issues #51 and #74
1 parent 1af1c37 commit c436ec9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/service.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,10 @@ module.exports = function (mixinOptions) {
612612
if (!this.shouldUpdateGraphqlSchema && this.graphqlHandler) {
613613
return;
614614
}
615+
616+
if (this.apolloServer) {
617+
this.apolloServer.stop();
618+
}
615619

616620
// Create new server & regenerate GraphQL schema
617621
this.logger.info(

0 commit comments

Comments
 (0)