{"id":13672397,"url":"https://github.com/async-graphql/graphgate","last_synced_at":"2025-04-04T22:04:50.988Z","repository":{"id":40575883,"uuid":"344320696","full_name":"async-graphql/graphgate","owner":"async-graphql","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-11T17:43:22.000Z","size":410,"stargazers_count":182,"open_issues_count":6,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T21:03:26.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/async-graphql.png","metadata":{"files":{"readme":"README-cn.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-04T02:05:06.000Z","updated_at":"2025-02-10T11:47:47.000Z","dependencies_parsed_at":"2024-01-06T07:48:46.622Z","dependency_job_id":"416b2ed8-2c32-46d4-9715-70ea70cf580b","html_url":"https://github.com/async-graphql/graphgate","commit_stats":{"total_commits":70,"total_committers":7,"mean_commits":10.0,"dds":0.3285714285714286,"last_synced_commit":"60f1006d93e1504e4a2b48fd6ac81d87e8e201d4"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fgraphgate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fgraphgate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fgraphgate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fgraphgate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/async-graphql","download_url":"https://codeload.github.com/async-graphql/graphgate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256110,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:01:34.363Z","updated_at":"2025-04-04T22:04:50.967Z","avatar_url":"https://github.com/async-graphql.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# GraphGate\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- CI --\u003e\n  \u003cimg src=\"https://github.com/async-graphql/graphgate/workflows/CI/badge.svg\" /\u003e\n  \u003c!-- codecov --\u003e\n  \u003cimg src=\"https://codecov.io/gh/async-graphql/graphgate/branch/master/graph/badge.svg\" /\u003e\n  \u003ca href=\"https://github.com/rust-secure-code/safety-dance/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/unsafe-forbidden-success.svg?style=flat-square\"\n      alt=\"Unsafe Rust forbidden\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nGraphGate 是一个用 Rust 语言实现的 [Apollo Federation](https://www.apollographql.com/apollo-federation) 网关。\n\n## 快速体验\n\n一个由3个服务(accounts, products, reviews)组成的完整GraphQL API。\n\n```shell\ndocker run -p 8000:8000 scott829/graphgate-standalone-demo:latest\n```\n\n打开浏览器[http://localhost:8000](http://localhost:8000)\n\n### 执行查询\n\n```graphql\n{\n    topProducts {\n        upc name price reviews {\n            body\n            author {\n                id\n                username\n            }\n        } \n    }\n}\n```\n\n### 执行订阅\n\n```graphql\nsubscription {\n    users {\n        id username reviews {\n            body\n        }\n    }\n}\n```\n\n## FAQ\n\n### Apollo Federation 是做什么的？\n\n在微服务架构中数据可能位于不同的位置，把多个服务提供的 API 合并到一起是一件有挑战的事情。\n\n为了解决这个问题，你可以使用 Federation 将API的实现划分为多个可组合服务：\n\n与其他分布式 GraphQL 结构（例如模式缝合）不同，Federation 使用声明性编程模型，该模型使每个服务仅实现图中负责的部分。\n\n### 为什么要用 Rust 实现它？\n\nRust是我最喜欢的编程语言，它安全并且快速，非常适合用于开发API网关这样的基础服务。\n\n### GraphGate和Apollo Federation的主要区别是什么？\n\n我猜GraphGate的性能会好很多（我还没有做基准测试，但很快会加上），并且**支持订阅**。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasync-graphql%2Fgraphgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasync-graphql%2Fgraphgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasync-graphql%2Fgraphgate/lists"}