finds.dev← search

// the find

mercurius-js/mercurius

★ 2,489 · JavaScript · MIT · updated Oct 2026

Implement GraphQL servers and gateways with Fastify

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.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →