Skip to content

feat(apollo): support the node http adapter - #4202

Merged
kamilmysliwiec merged 1 commit into
masterfrom
feat/node-adapter
Oct 27, 2026
Merged

kamilmysliwiec merged 1 commit into
masterfrom
feat/node-adapter

Conversation

@kamilmysliwiec

Copy link
Copy Markdown
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

The Apollo driver throws No support for current HttpAdapter: node with the native Node adapter of @nestjs/platform-node (12.3.0).

Issue Number: N/A

What is the new behavior?

The driver registers Apollo for the Node adapter as it does for Express, through @as-integrations/express5. The adapter's requests and responses carry the Express API that integration uses (req.body, req.headers, req.url, res.status(), res.send(), res.setHeader(), res.write()), and it imports nothing from express at runtime.

New e2e specs run on the Node adapter:

  • e2e/graphql-node.spec.ts: a query and the GraphiQL landing page
  • e2e/global-prefix-node.spec.ts: the cases of global-prefix.spec.ts
  • subscriptions/graphql-ws-node.spec.ts: the graphql-ws cases

They fail without the change. The whole Apollo e2e suite passes (62 files, 243 tests). @nestjs/platform-node 12.3.0 is added as a devDependency for these specs. Mercurius stays Fastify-only.

This works with @nestjs/platform-node 12.3.0 as published, so there's nothing to wait for before releasing.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The Apollo driver threw "No support for current HttpAdapter: node" for
the native Node adapter of @nestjs/platform-node (12.3.0). Its requests
and responses carry the Express API that Apollo's Express integration
(@as-integrations/express5) uses, so the driver now registers the server
the same way as for Express. Queries, the GraphiQL landing page, a global
prefix and graphql-ws subscriptions are covered by e2e specs on the Node
adapter.
@kamilmysliwiec
kamilmysliwiec merged commit 9941b5a into master Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant