finds.dev

mercurius-js/mercurius

Implement GraphQL servers and gateways with Fastify

View on GitHubHomepage ↗

★ 2,489JavaScriptMITupdated Oct 2026

// the take

Mercurius is a GraphQL adapter for Fastify that bundles schema setup, query caching, a graphql-jit compiler, loaders for batching, and subscriptions into one plugin. Federation and gateway support ship as separate @mercuriusjs packages. It suits teams already running Fastify who want GraphQL without a second server framework.

Query depth limiting and CSRF protection are in the core (lib/queryDepth.js and lib/csrf.js, with a dedicated CSRF doc), so you don't have to find and vet a plugin for either. Loaders are a first-class part of the API for the N+1 problem, and persisted and batched queries have their own docs and tests (test/persisted.test.js, test/batched.test.js). The test directory is split by concern, with separate files for hooks, subscriptions, loaders, validation rules and the adaptive JIT, which makes it easier to see what is actually covered.

Fastify is a hard dependency. If your service runs on Express, Koa or Hono, none of this applies. Federation and gateway live in separate repos and packages, and the core README doesn't say which mercurius, @mercuriusjs/federation and @mercuriusjs/gateway versions work together, so you end up checking changelogs yourself. The examples directory has an in-memory subscription example and a MongoDB-backed mqemitter one, which means a multi-instance deployment requires choosing and running your own pubsub backend. The README is mostly a list of links, and the real options and API reference sit in docs/api/options.md, so the quick start says little about production setup.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
2,489
Forks
256
Language
JavaScript
License
MIT
Last commit
5 Oct 2026

// nearby

If mercurius isn't quite it.

All repos →