Type issue when using expressMiddleware() with an ApolloServer with a custom context
### Issue Description

Title is descriptive:
https://github.com/apollographql/apollo-server/blob/main/packages/server/src/express4/index.ts#L22

Reproduce it:
```ts
const server = new ApolloServer<CustomContext>({ ... });
expressMiddleware(server) // fails if I have a mandatory variable in my CustomContext because it cannot assign it to BaseContext
```

Current solution:
```
expressMiddleware(server as unknown as ApolloServer<BaseContext>)
```

Potential solution:
make it ApolloServer<T extends BaseContext> and write a type-check test.

### Link to Reproduction

https://github.com/apollographql/apollo-server/blob/main/packages/server/src/express4/index.ts#L22

### Reproduction Steps

_No response_