Why isn't Apollo Server a middleware for Express, rather than being a server that accepts Express as a middleware? Why isn't Apollo Server a middleware for Express, rather than being a server that accepts Express as a middleware? express express

Why isn't Apollo Server a middleware for Express, rather than being a server that accepts Express as a middleware?


I don't work with those guys, but based off the code that is there, I assume it has to do with the fact that it adds body-parser, upload capability, websockets (if you opt into this one) to the app, as well as a .well-known configuration for engine's health checks. The well-known would have to be at root according to that spec. Additionally, if you're using the subscriptions and websockets, they listen for httpServer.once('listening'), so they have to have access to your app. If they simply handed you one that you could mount, you wouldn't app.listen on it, since you'd app.listen on your own instead.

Just from the internals, this is what I would expect, at least.