Skip to content

Commit

Permalink
Add more types to installSubscriptionHandlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Binbin committed Jun 17, 2020
1 parent 4c5c455 commit 41ad161
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/apollo-server-core/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import {
addMockFunctionsToSchema,
GraphQLParseOptions,
} from 'graphql-tools';
import { Server as NetServer } from 'net'
import { Server as TlsServer } from 'tls'
import { Server as HttpServer } from 'http';
import { Http2Server, Http2SecureServer } from 'http2';
import { Server as HttpsServer } from 'https';
import loglevel from 'loglevel';
import {
execute,
Expand Down Expand Up @@ -602,7 +606,7 @@ export class ApolloServerBase {
}
}

public installSubscriptionHandlers(server: HttpServer | WebSocket.Server) {
public installSubscriptionHandlers(server: HttpServer | HttpsServer | Http2Server | Http2SecureServer | WebSocket.Server) {
if (!this.subscriptionServerOptions) {
if (this.config.gateway) {
throw Error(
Expand Down Expand Up @@ -678,7 +682,7 @@ export class ApolloServerBase {
keepAlive,
validationRules: this.requestOptions.validationRules
},
server instanceof HttpServer
server instanceof NetServer || server instanceof TlsServer
? {
server,
path,
Expand Down

0 comments on commit 41ad161

Please sign in to comment.