You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/02 12:15:45 UTC

[GitHub] [apisix-website] yzeng25 commented on a change in pull request #930: docs: add GraphQL blog

yzeng25 commented on a change in pull request #930:
URL: https://github.com/apache/apisix-website/pull/930#discussion_r817631094



##########
File path: website/i18n/zh/docusaurus-plugin-content-blog/2022/03/02/apisix-integration-graphql-plugin.md
##########
@@ -0,0 +1,347 @@
+---
+title: "GraphQL 碰撞 API 网关 Apache APISIX,提升 API 领域的安全与性能"
+authors:
+  - name: "江晨炜"
+    title: "Author"
+    url: "https://github.com/Chever-John"
+    image_url: "https://avatars.githubusercontent.com/u/43690894?v=4"
+  - name: "韩飞"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://avatars.githubusercontent.com/u/97138894?v=4"
+keywords: 
+- Apache APISIX
+- API Gateway
+- GraphQL
+- Ecosystem
+description: 本文介绍了 Apache APISIX 和 GraphQL 的特性,以及如何使用云原生 API 网关 Apache APISIX 代理 GraphQL 请求,并提出解决实际场景痛点的方案。
+tags: [Technology,Ecosystem,Security]

Review comment:
       The `Security` tag is meant for CVE news. Please delete this tag to avoid confusion.

##########
File path: website/i18n/zh/docusaurus-plugin-content-blog/2022/03/02/apisix-integration-graphql-plugin.md
##########
@@ -0,0 +1,347 @@
+---
+title: "GraphQL 碰撞 API 网关 Apache APISIX,提升 API 领域的安全与性能"
+authors:
+  - name: "江晨炜"
+    title: "Author"
+    url: "https://github.com/Chever-John"
+    image_url: "https://avatars.githubusercontent.com/u/43690894?v=4"
+  - name: "韩飞"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://avatars.githubusercontent.com/u/97138894?v=4"
+keywords: 
+- Apache APISIX
+- API Gateway
+- GraphQL
+- Ecosystem
+description: 本文介绍了 Apache APISIX 和 GraphQL 的特性,以及如何使用云原生 API 网关 Apache APISIX 代理 GraphQL 请求,并提出解决实际场景痛点的方案。
+tags: [Technology,Ecosystem,Security]
+---
+
+> 本文介绍了 Apache APISIX 和 GraphQL 的特性,以及如何使用 API 网关 Apache APISIX 代理 GraphQL 请求,并提出解决实际场景痛点的方案。
+
+<!--truncate-->
+
+## 背景信息
+
+GraphQL 是一个开源的、面向 API 而创造出来的数据查询操作语言以及相应的运行环境。最初由 Facebook 于 2012 年内部开发,2015 年公开发布。2018 年 11 月 7 日,Facebook 将 GraphQL 项目转移到新成立的 GraphQL 基金会。
+
+您可以把 GraphQL 类比为 SQL 查询语句来理解,与 SQL 查询语句相比,GraphQL 对 API 中的数据提供了一套易于理解的完整描述,让客户端能够通过自定义的描述来准确获得其所需要的数据。这也让 API 能够从容面对日益复杂的接口发展,并避免最终成为一个令人望而生畏的复杂接口。
+
+Apache APISIX 是一个动态、实时、高性能的 API 网关,提供负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。
+
+Apache APISIX 作为云原生 API 网关,在设计之初就已经具备识别 GraphQL 语法的匹配能力。通过对请求中携带的 GraphQL 语句进行高效匹配,筛除异常流量,进一步保证安全性和提高系统性能。
+
+### 场景解析
+
+我们正处于大数据大流量的时代,Apache APISIX 和  GraphQL 可以通过结合的方式,形成共赢的局面。接下来举一个场景具体说明。
+
+本文将会讨论微服务架构场景下的 Apache APISIX 和 GraphQL 的实际应用。
+
+### 实际场景中遇到的问题
+
+在项目进行到后期时,往往会出现业务复杂化、团队人员流动性高等问题,而微服务架构已经成为解决这类问题的常见解决方案。在微服务架构中,GraphQL 暴露出的接口分为分散式和集中式两种,然而只有集中式接口设计才能够最大化体现 GraphQL 的优势,但是在集中式接口设计中,所有的微服务对外暴露的是同一个接口,**因此处理流量的路由就不能简单地根据 URL 进行转发,而是应该根据请求中包含的不同字段进行转发**。
+
+由于 NGINX 处理请求时仅会处理 URL 以及一些参数,但是只有解析请求参数中的查询信息才可以知道客户端访问的资源,从而进行路由转发,因此这种路由转发方式通过传统的 NGINX 是无法完成的。在实际应用场景中,将 GraphQL 接口直接对外暴露非常危险,因此需要一个专业的高性能 API 网关保护 GraphQL 的接口。
+
+### 解决方案
+
+基于 Apache APISIX 安全、稳定、高性能的特性,增加 GraphQL 灵活的路由匹配规则是解决 GraphQL 集中式接口设计问题的最佳方案。
+
+![error/graphql.png](https://static.apiseven.com/202108/1646200966179-1d649ab0-8d49-49f5-a8fa-a1a30af0519d.png)

Review comment:
       I think the image name is duplicated with line 65. Please change one of them or both of them.

##########
File path: website/blog/2022/03/02/apisix-integration-graphql-plugin.md
##########
@@ -0,0 +1,347 @@
+---
+title: "How to Use GraphQL with API Gateway Apache APISIX"
+authors:
+  - name: "JohnChever"
+    title: "Author"
+    url: "https://github.com/Chever-John"
+    image_url: "https://avatars.githubusercontent.com/u/43690894?v=4"
+  - name: "Fei Han"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://avatars.githubusercontent.com/u/97138894?v=4"
+keywords: 
+- Apache APISIX
+- API Gateway
+- GraphQL
+- Ecosystem
+description: This article introduces the features of Apache APISIX and GraphQL, and how to use the API gateway Apache APISIX to proxy GraphQL requests, and proposes solutions to solve the pain points of practical scenarios.
+tags: [Technology,Ecosystem,Security]

Review comment:
       The Security tag is meant for CVE news. Please delete this tag to avoid confusion.
   ```suggestion
   tags: [Technology,Ecosystem]
   ```

##########
File path: website/blog/2022/03/02/apisix-integration-graphql-plugin.md
##########
@@ -0,0 +1,347 @@
+---
+title: "How to Use GraphQL with API Gateway Apache APISIX"
+authors:
+  - name: "JohnChever"
+    title: "Author"
+    url: "https://github.com/Chever-John"
+    image_url: "https://avatars.githubusercontent.com/u/43690894?v=4"
+  - name: "Fei Han"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://avatars.githubusercontent.com/u/97138894?v=4"
+keywords: 
+- Apache APISIX
+- API Gateway
+- GraphQL
+- Ecosystem
+description: This article introduces the features of Apache APISIX and GraphQL, and how to use the API gateway Apache APISIX to proxy GraphQL requests, and proposes solutions to solve the pain points of practical scenarios.
+tags: [Technology,Ecosystem,Security]
+---
+
+> This article introduces the features of Apache APISIX and GraphQL, and how to use the API gateway Apache APISIX to proxy GraphQL requests, and proposes solutions to solve the pain points of practical scenarios.
+
+<!--truncate-->
+
+## Background Information
+
+GraphQL is an open source, API oriented data query operation language and corresponding running environment. Originally developed internally by Facebook in 2012 and publicly released in 2015. On November 7, 2018, Facebook transferred the GraphQL project to the newly established GraphQL foundation.
+
+You can understand GraphQL by analogy with SQL query statements. Compared with SQL query statements, GraphQL provides an easy to understand and complete description of the data in the API, so that the client can accurately obtain the data it needs through the customized description. This also allows the API to calmly face the development of increasingly complex interfaces and avoid eventually becoming a daunting complex interface.
+
+Apache APISIX is a dynamic, real-time, high-performance API gateway that provides rich traffic management features such as load balancing, dynamic upstream, canary release, circuit breaking, authentication, observability, and more.
+
+As a cloud native API gateway, Apache APISIX already has the matching ability to recognize GraphQL syntax at the beginning of its design. By efficiently matching GraphQL statements carried in requests, it can filter out abnormal traffic to further ensure security and improve system performance.
+
+### Scene Analysis
+
+We are in the era of big data and large traffic, Apache APISIX and GraphQL can be combined to form a win-win situation. The following is a detailed description of a scenario.
+
+This article will discuss the practical application of Apache APISIX and GraphQL in the context of microservice architecture.
+
+### Problems Encountered In the Actual Scene
+
+In the late stage of the project, business complexity and team mobility are often the problems. Micro service architecture has become a common solution to such problems. In microservice architecture, GraphQL exposes two kinds of interfaces: decentralized and centralized. However, only centralized interface design can maximize GraphQL's advantages. However, in centralized interface design, all microservices are exposed to the same interface. **So processing flow routing cannot simply forwarded according to the URL, but should be based on the request contained in different fields are forwarded.**
+
+Because NGINX only processes URLs and some parameters when processing requests, but only by parsing the query information in the request parameters can the resources accessed by the client be known, so as to perform routing forwarding, so this routing forwarding method cannot be completed through traditional NGINX. . In practical application scenarios, it is very dangerous to directly expose the GraphQL interface to the outside world, so a professional high-performance API gateway is required to protect the GraphQL interface.
+
+### Solution
+
+Based on the security, stability, and high performance of Apache APISIX, adding flexible routing matching rules to GraphQL is the best solution to GraphQL's centralized interface design.
+
+![error/graphql.png](https://static.apiseven.com/202108/1646200966179-1d649ab0-8d49-49f5-a8fa-a1a30af0519d.png)

Review comment:
       I think the image name is duplicated with line 65. Please change one of them or both of them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org