Officially support more server frameworks than express #7991
Replies: 1 comment
-
The main design goal of Apollo Server v4 was to not have to support individual web frameworks one-by-one as core dependencies. What you are suggesting was the strategy taken by Apollo Server v2 and v3, and it was completely untenable. Writing an integration to your favorite web framework takes about a page of code. We will not be adding any more of them to Apollo Server's core. We are more likely to remove the Express integration in a future major version with no replacement (ie, ship 0 built-in frameworks other than the standalone server) than we are to ship a version of Apollo Server with multiple built-in integrations. The community integrations are rarely updated because they are stable and work. The main thing the integration does is map from Apollo Server's abstract representation of HTTP requests and responses to the framework's representation. Unsurprisingly, most web frameworks do not drastically change the way they represent HTTP headers frequently. |
Beta Was this translation helpful? Give feedback.
-
From what I can tell, there's been little discussion about supporting other server frameworks than express, but considering how poorly it performs compared to the competition I think it's a valid question to ask. This was not the case when express was chosen, but this space has moved quite a bit since then.
Benchmarks for context: https://web-frameworks-benchmark.netlify.app/compare?f=fastify,express,hono
Relying on something like hono instead would also remove a lot of the dependencies.
Today there exists a few community integrations for other frameworks, but these are rarely updated. An official integration is a lot easier to stand behind as a company than a community integration that does not receive updates.
Beta Was this translation helpful? Give feedback.
All reactions