Skip to content

Commit 72f410d

Browse files
committed
Stop casting to net.AddressInfo type as that should already be inferred.
This is necessary after the changes in 0f75909 and #2344, as the `AddressInfo` type didn't become available until a future version of `@types/node`. Regardless, it seems to me that this should be inferred without any problem and we don't actually rely on the `AddressInfo` type, and instead are only looking for an interface which has `port`, `address` and `family`, as the inferred return value from `http.Server.prototype.address()` does.
1 parent 0f75909 commit 72f410d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/apollo-server/src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// you're not using express or your version doesn't quite match up.
55
import express from 'express';
66
import http from 'http';
7-
import net from 'net';
87
import {
98
ApolloServer as ApolloServerBase,
109
CorsOptions,
@@ -37,7 +36,7 @@ export class ApolloServer extends ApolloServerBase {
3736
subscriptionsPath?: string,
3837
): ServerInfo {
3938
const serverInfo: any = {
40-
...(server.address() as net.AddressInfo),
39+
...server.address(),
4140
server,
4241
subscriptionsPath,
4342
};

0 commit comments

Comments
 (0)