graphql - Falcor 和 GraphQL 有什么区别?

标签 graphql relayjs falcor

GraphQL consists of a type system, query language and execution semantics, static validation, and type introspection, each outlined below. To guide you through each of these components, we've written an example designed to illustrate the various pieces of GraphQL.

-https://github.com/facebook/graphql

Falcor lets you represent all your remote data sources as a single domain model via a virtual JSON graph. You code the same way no matter where the data is, whether in memory on the client or over the network on the server.

-http://netflix.github.io/falcor/

Falcor 和 GraphQL(在 Relay 的上下文中)有什么区别?

最佳答案

我已查看Angular Air Episode 26: FalcorJS and Angular 2哪里Jafar Husain答案如何GraphQLFalcorJS相比。这是摘要(释义):

  • FalcorJS 和 GraphQL 正在解决相同的问题(查询数据、管理数据)。
  • 重要的区别是 GraphQL 是一种查询语言,而 FalcorJS 不是。
  • 当您向 FalcorJS 请求资源时,您非常明确地请求有限序列的值。 FalcorJS 确实支持范围之类的东西,例如流派[0..10]。但它不支持开放式查询,例如流派[0..*].
  • GraphQL 是基于集合的:给我所有真实的记录、按此排序等。从这个意义上说,GraphQL 查询语言比 FalcorJS 更强大。
  • 借助 GraphQL,您可以拥有强大的查询语言,但您必须在服务器上解释该查询语言。

贾法尔认为,在大多数应用程序中,从客户端到服务器的查询类型共享相同的形状。因此,拥有特定且可预测的操作(例如 get 和 set)可以提供更多利用缓存的机会。此外,许多开发人员熟悉在 REST 架构中使用简单的路由器来映射请求。

最后的讨论围绕 GraphQL 的功能是否超过复杂性展开。

关于graphql - Falcor 和 GraphQL 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32057785/

相关文章:

javascript - 使用 RelayJS 中的数据通过 React JS 过滤名称列表,而不调用 GraphQL

mongodb - 在 Falcor 中如何使用数据库?

graphql - 如何让 RelayJS 理解来自 GraphQL 的响应是一个项目数组,而不仅仅是一个项目

Relay 和 GraphQL 中的身份验证

falcor - 如何在 Falcor 中构建多参数搜索

javascript - Netflix 猎鹰 : Filters in model's get operation

reactjs - 使用 header 配方的 Apollo 授权不起作用

graphql - 如何在 gatsby graphql 中查询日期范围?

GitHub GraphQL API Filter on Project V2 中的自定义文本字段

graphql - 使用 Apollo Federated GraphQL,有没有办法对来自外部实体的值进行排序/分页?