graphql 客户端_2020年的6个GraphQL顶级客户

graphql 客户端

We’ll be looking at some of the top GraphQL clients for 2020. Before getting started, it is essential that you have a basic understanding of GraphQL and its server-side and client-side applications.

我们将研究2020年的一些顶级GraphQL客户端。在开始之前,对GraphQL及其服务器端和客户端应用程序有基本的了解是至关重要的。

什么是GraphQL? (What is GraphQL?)

If GraphQL seems somewhat familiar, it’s because it sounds like the names of other types of Query Languages like MySQL. While GraphQL is a Query Language (QL), it works differently to a typical QL. It uses a single API endpoint to allow applications to query for exactly the data they want through an HTTP Post request. This is a significant improvement from having to call upon a specific endpoint for each data type.

如果GraphQL看起来有些熟悉,那是因为它听起来像MySQL等其他类型的查询语言的名称。 尽管GraphQL是一种查询语言(QL),但它的工作方式不同于典型的QL。 它使用单个API端点,以允许应用程序通过HTTP Post请求精确查询所需的数据。 与必须为每种数据类型调用特定终结点相比,这是一个重大改进。

This technology is relatively new and was released to the public by Facebook in 2015. However, it was part of Facebook since 2012 and has seen rapid growth and acceptance since. It is a powerful Query Language that can be used to communicate between a client (usually a browser-based application) and a server. It enables structuring data-driven applications more efficiently compared to a RESTful approach.

该技术是相对较新的技术,于2015年由Facebook公开发布。但是,自2012年以来,它已成为Facebook的一部分,自此以来Swift增长并被接受。 它是一种功能强大的查询语言,可用于在客户端(通常是基于浏览器的应用程序)和服务器之间进行通信。 与RESTful方法相比,它可以更有效地构建数据驱动的应用程序。

GraphQL can be implemented in any server-side language and frontend language framework. It is essential to keep in mind that GraphQL is not bound to any particular database technology or application.

GraphQL可以用任何服务器端语言和前端语言框架来实现。 必须记住,GraphQL不受任何特定数据库技术或应用程序的约束。

GraphQL的优势 (The Advantages of GraphQL)

  • In comparison to RESTful web services, it is possible to request specific data points without receiving the entire data object. The required data points can be specified in the GraphQL query (HTTP Post request).

    与RESTful Web服务相比,可以在不接收整个数据对象的情况下请求特定的数据点。 可以在GraphQL查询(HTTP Post请求)中指定所需的数据点。
  • GraphQL is strongly typed, and strict document requirements make the available data points transparent to client applications.

    GraphQL是强类型的,并且严格的文档要求使可用的数据点对客户端应用程序透明。
  • One disadvantage of RESTful endpoints is that they require a lot of maintenance if your organization’s data structure changes frequently. GraphQL is flexible and allows adapting to these changes rapidly as the changes only need to be handled in the GraphQL queries.

    RESTful终结点的一个缺点是,如果组织的数据结构频繁更改,则它们需要大量维护。 GraphQL具有灵活性,并允许快速适应这些更改,因为这些更改仅需要在GraphQL查询中进行处理。

GraphQL的缺点 (The Disadvantages of GraphQL)

While GraphQL has many advantages, it also brings along some fundamental issues that can be deal-breakers.

尽管GraphQL具有许多优点,但它也带来了一些可能破坏交易的基本问题。

  • Unlike RESTful endpoints, GraphQL’s single endpoint does not have native caching capabilities. You will need to set up your own caching logic.

    与RESTful终结点不同,GraphQL的单个终结点不具有本地缓存​​功能。 您将需要设置自己的缓存逻辑。
  • Another issue is that all requests return an HTTP 200 response, irrespective of the response’s actual status.

    另一个问题是,无论响应的实际状态如何,所有请求都将返回HTTP 200响应。
  • Setting up a GraphQL endpoint can be relatively more complicated than a RESTful web service. If your data structures are relatively simple and don’t require constant changes, it may be worthwhile to avoid GraphQL.

    设置GraphQL端点可能比RESTful Web服务相对复杂。 如果您的数据结构相对简单并且不需要不断更改,则避免GraphQL是值得的。

As you now know the pros and cons of GraphQL, let’s see the best GraphQL clients for 2020.

现在您知道了GraphQL的优缺点,让我们来看看2020年最好的GraphQL客户。

Tip: Use Bit (Github) to share, document, and manage reusable React components. It’s a great way to increase code reuse, speed up development, and build apps that scale.

提示:使用Bit ( Github )共享,记录和管理可重用的React组件。 这是增加代码重用,加速开发并构建可扩展应用程序的好方法。

Image for post
Example: exploring shared React components on Bit.dev
示例:在 Bit.dev上浏览共享的React组件

1.阿波罗客户 (1. Apol

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值