Skip to content

Commit

Permalink
fix : unhandled promise rejection in registerFastify method
Browse files Browse the repository at this point in the history
Apollo server throws unhandled promise rejection when using fastify adapter, now it awaits for the server to start and then proceeds with the createHandler method

fix issue #1536
  • Loading branch information
maazkabir committed May 20, 2021
1 parent c6e76e3 commit 72113af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/federation/graphql-federation.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export class GraphQLFederationModule implements OnModuleInit, OnModuleDestroy {
}

const apolloServer = new ApolloServer(apolloOptions as any);
await apolloServer.start();
const {
disableHealthCheck,
onHealthCheck,
Expand Down
1 change: 1 addition & 0 deletions lib/federation/graphql-gateway.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export class GraphQLGatewayModule implements OnModuleInit, OnModuleDestroy {
const path = this.getNormalizedPath(apolloOptions);

const apolloServer = new ApolloServer(apolloOptions);
await apolloServer.start();
const {
disableHealthCheck,
onHealthCheck,
Expand Down
1 change: 1 addition & 0 deletions lib/graphql.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export class GraphQLModule implements OnModuleInit, OnModuleDestroy {
const path = this.getNormalizedPath(apolloOptions);

const apolloServer = new ApolloServer(apolloOptions as any);
await apolloServer.start();
const {
disableHealthCheck,
onHealthCheck,
Expand Down

0 comments on commit 72113af

Please sign in to comment.