apollo-server
apollo-server copied to clipboard
Add a test showing http/2 works
Apollo Server v3 used node-fetch
Request
s to represent incoming requests, and those objects aren't compatible with http/2 requests which have colons in header names. See #2333 and #1533.
We think that AS4 (which no longer uses that representation for requests) should support http/2. It would be great to get a PR adding a test!
hi @glasser, I am a new contributor and I would be happy to work on this issue.
would I add this test to the general apolloServerTests.ts
suite?
Sure! Alternatively, add it to packages/server/src/__tests__/express4/expressSpecific.test.ts
and do it just for express middleware, since not all integrations might support HTTP/2.
Provide an example to how to create apollo server with http2 and express.
AS4 ships only with a simple standalone server and an Express middleware, and Express doesn't support http2 out of the box without using one of various "bridge" packages. So putting tests for this in the AS core repo might not make much sense. Perhaps we should find an integration for a framework that does support http2 (like Koa) and put a test like this into its integration repository. Once we have evidence that it's possible to do that for some framework, perhaps we can close this issue.
https://github.com/apollo-server-integrations/apollo-server-integration-koa/pull/87 should suffice to close this out.
We just migrated to AS4 at my company in PROD today (using koa integration). I've also manually tested and have proven sending GraphQL requests via http2 cleartext works just fine, but we haven't transitioned to using it yet, need to get changes made to our service mesh and kubernetes to support h2c health checks/readiness checks/etc before we can do that.