ランキングに戻る

mercurius-js/mercurius

JavaScriptmercurius.dev

Implement GraphQL servers and gateways with Fastify

gatewaygraphqlnodejsfastifyhacktoberfestfederation
スター成長
スター
2.5k
フォーク
253
週間成長
Issue
47
1k2k
2018年9月2021年4月2023年12月2026年7月
成果物npmnpm install mercurius
README

Mercurius Logo

mercurius

CI workflow NPM version NPM downloads neostandard javascript style

Mercurius is a GraphQL adapter for Fastify

Features:

  • Caching of query parsing and validation.
  • Automatic loader integration to avoid 1 + N queries.
  • Just-In-Time compiler via graphql-jit.
  • Subscriptions.
  • Federation support via @mercuriusjs/federation, including Subscriptions.
  • Gateway implementation via @mercuriusjs/gateway, including Subscriptions.
  • Batched query support.
  • Customisable persisted queries.

Docs

Install

npm i fastify mercurius graphql
# or
yarn add fastify mercurius graphql

The previous name of this module was fastify-gql (< 6.0.0).

Quick Start

'use strict'

const Fastify = require('fastify')
const mercurius = require('mercurius')

const app = Fastify()

const schema = `
  type Query {
    add(x: Int, y: Int): Int
  }
`

const resolvers = {
  Query: {
    add: async (_, { x, y }) => x + y
  }
}

app.register(mercurius, {
  schema,
  resolvers
})

app.get('/', async function (req, reply) {
  const query = '{ add(x: 2, y: 2) }'
  return reply.graphql(query)
})

app.listen({ port: 3000 })

Examples

Check GitHub repo for more examples.

Contributing

Mercurius is an OPEN Open Source Project. This means that:

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.

See the CONTRIBUTING.md file for more details.

Acknowledgements

The project is kindly sponsored by:

The Mercurius name was gracefully donated by Marco Castelluccio. The usage of that library was described in https://hacks.mozilla.org/2015/12/web-push-notifications-from-irssi/, and you can find that codebase in https://github.com/marco-c/mercurius.

License

MIT

関連リポジトリ
BerriAI/litellm

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

PythonPyPIOtheranthropiclangchain
docs.litellm.ai/docs/
54.3k10k
zeromicro/go-zero

A cloud-native Go microservices framework with cli tool for productivity.

GoGo ModulesMIT Licensegolangmicroservice
go-zero.dev
33.2k4.3k
forezp/SpringCloudLearning

《史上最简单的Spring Cloud教程源码》

JavaMavenspring-cloudspring-boot
17.9k8k
Portkey-AI/gateway

A blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.

TypeScriptnpmMIT Licensegatewaygenerative-ai
portkey.ai/features/ai-gateway
12.5k1.2k
rmyndharis/OpenWA

Free, Open Source, Self-Hosted WhatsApp API Gateway

TypeScriptnpmMIT Licenseapigateway
open-wa.org
11.7k2.6k
ThreeMammals/Ocelot

.NET API Gateway

C#MIT Licenseocelotdotnet
ocelot.readthedocs.io
8.7k1.7k
mnfst/manifest

Connect Your Agents And Harnesses With Any Provider 🦚

TypeScriptnpmMIT Licenseopenclawcost-tracking
manifest.build
7.3k479
katanemo/plano

Plano is an AI-native proxy server and data plane for agentic apps. Smart LLM routing, observability, agent orchestration, and guardrails so you stay focused on your agents core logic.

Rustcrates.ioApache License 2.0gatewaygenerative-ai
planoai.dev
6.9k469
luraproject/lura

Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation

GoGo ModulesOtherapi-gatewaymicroservice
luraproject.org
6.8k585
maximhq/bifrost

Fastest enterprise AI gateway (50x faster than LiteLLM) with adaptive load balancer, cluster mode, guardrails, 1000+ models support & <100 µs overhead at 5k RPS.

GoGo ModulesApache License 2.0gatewayllm
getmaxim.ai/bifrost
6.7k920
easegress-io/easegress

A Cloud Native traffic orchestration system

GoGo ModulesApache License 2.0gohttp
megaease.com/easegress/
5.9k496
dromara/lamp-cloud

[灯灯]微服务中后台快速开发平台,支持jdk21、jdk17、jdk8,专注于多租户、开放平台解决方案,亦可作为普通项目(非SaaS架构)的基础开发框架使用,目前已实现插拔式数据库隔离、SCHEMA隔离、字段隔离 等租户隔离方案。

JavaMavenApache License 2.0springcloudspringboot
tangyh.top
5.7k1.8k