知识卡片
GraphQL按需跨源取字段
GraphQL 在多个服务、数据存储或 API 之上提供查询层,让消费者按需要选择字段,并可通过统一模式跨来源组合数据。它适合客户端只需部分字段或需要聚合多源数据的场景;统一入口虽隐藏内部拓扑,仍要维护模式与下游接口的对应关系。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
- · 消费者与接口风格
原书出处 · 1 处
- · 查看原书依据
GraphQL introduces a technology layer over existing services, datastores, and APIs that provides a query language to query across multiple sources. The query language allows the client to ask for exactly the fields required, including fields that span across multiple APIs. GraphQL uses the GraphQL schema language, to specify the types in individual APIs and how APIs combine.
参考来源
- 位置:《Mastering API Architecture》第1章《Design, Build, and Specify APIs》之《A Brief Mention of GraphQL》(源文件:_epub-src/OEBPS/ch01.xhtml)
- 结论依据:原文说明 GraphQL 查询语言可跨多来源选择恰好需要的字段,并由 schema 描述类型及 API 组合。
- 原始内容:GraphQL introduces a technology layer over existing services, datastores, and APIs that provides a query language to query across multiple sources. The query language allows the client to ask for exactly the fields required, including fields that span across multiple APIs. GraphQL uses the GraphQL schema language, to specify the types in individual APIs and how APIs combine.