types: Use explicit return type of express.Router
on getMiddleware
.
#3230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The TypeScript compiler is inferring the return type of this method
accurately, but emitting
import("express-serve-static-core")
directly intothe
apollo-server-express
type definitions.Looking at the
package-lock.json
for the Apollo Server repository, I havea working theory that there are multple
@types/express
's within this projectand that, when resolving the imports in the delcarations, a copy of
express-serve-static-core
is not quite in the right resolution path —potentially due to some package hoisting and module resolution.
To be honest, it's just a theory and I only spent about 3 or 4 minutes
looking at this, but I hope that this will address #3222 (intentionally not
using the keyword "Fixes" here because we'll wait for validation!)
cc @CallMeLaNN