📦graphiti-api / graphiti
← 返回首页
Stylish Graph APIs
⚖️ MIT#json-api#rails#api#graphiti#microservices🌐 graphiti.dev📅 创建于 2016-09-22🔄 更新于 2026-10-22

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

Graphiti

CI Gem Version Ruby Style Guide semantic-release: angular

discord guides

Graphiti logo

Graphiti sits on top of your models (usually ActiveRecord) and exposes them over a JSON:API-compliant interface. You define Resources instead of controllers and serializers, and get filtering, sorting, pagination, sparse fieldsets, statistics, and nested reads and writes across relationships, all over one endpoint.

It's built on the JSON:API spec, which settles the decisions every API accumulates: response shapes, filtering, sorting, pagination, error formats, and how related data rides along. Your client layer speaks this protocol in return. It isn't complicated, so client logic can be hand-rolled or you can use one of the many available libraries that work with the standard.

A Resource looks like this:

class EmployeeResource < ApplicationResource
  attribute :first_name, :string
  attribute :last_name, :string
  attribute :age, :integer

  has_many :positions
end

That Resource serves ?filter[age][gt]=30, ?sort=-age, ?page[size]=10, ?include=positions and more, without writing any of them. See graphiti.dev for the whole loop, or the example app for a full working API.

Documentation

Docs live at graphiti.dev and are rendered from this repo: the markdown is in /docs, and the Docusaurus site that serves it is in /website. Fixes and improvements are welcome (every page has an "Edit this page" link at the bottom, which makes opening a PR with a change easy).

To preview locally:

cd website
npm install
npm run start

Join the Discord

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR