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 08:07:50 UTC

[GitHub] [apisix] hf400159 commented on a change in pull request #6449: docs: add latest content about GraphQL in APISIX

hf400159 commented on a change in pull request #6449:
URL: https://github.com/apache/apisix/pull/6449#discussion_r817433429



##########
File path: docs/zh/latest/router-radixtree.md
##########
@@ -290,6 +292,34 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
 }'
 ```
 
+我们可以通过以下两种方式分别去验证 GraphQL 匹配:
+
+1. 使用 GraphQL 查询字符串
+
+```shell
+$ curl -H 'content-type: application/graphql' -X POST http://127.0.0.1:9080/graphql -d '

Review comment:
       ```suggestion
   curl -H 'content-type: application/graphql' -X POST http://127.0.0.1:9080/graphql -d '
   ```

##########
File path: docs/zh/latest/router-radixtree.md
##########
@@ -274,7 +276,7 @@ query getRepo {
 ```shell
 $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '

Review comment:
       ```suggestion
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   ```

##########
File path: docs/zh/latest/router-radixtree.md
##########
@@ -290,6 +292,34 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
 }'
 ```
 
+我们可以通过以下两种方式分别去验证 GraphQL 匹配:
+
+1. 使用 GraphQL 查询字符串
+
+```shell
+$ curl -H 'content-type: application/graphql' -X POST http://127.0.0.1:9080/graphql -d '
+query getRepo {
+    owner {
+        name
+    }
+    repo {
+        created
+    }
+}'
+```
+
+2. 使用 JSON 格式
+
+```shell
+$ curl -H 'content-type: application/json' -X POST http://127.0.0.1:9080/graphql --data '{"query": "query getRepo { owner {name } repo {created}}"}'

Review comment:
       ```suggestion
   curl -H 'content-type: application/json' -X POST http://127.0.0.1:9080/graphql \
   --data '{"query": "query getRepo { owner {name } repo {created}}"}'
   ```

##########
File path: docs/zh/latest/router-radixtree.md
##########
@@ -290,6 +292,34 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
 }'
 ```
 
+我们可以通过以下两种方式分别去验证 GraphQL 匹配:
+
+1. 使用 GraphQL 查询字符串
+
+```shell
+$ curl -H 'content-type: application/graphql' -X POST http://127.0.0.1:9080/graphql -d '
+query getRepo {
+    owner {
+        name
+    }
+    repo {
+        created
+    }
+}'
+```
+
+2. 使用 JSON 格式
+
+```shell
+$ curl -H 'content-type: application/json' -X POST http://127.0.0.1:9080/graphql --data '{"query": "query getRepo { owner {name } repo {created}}"}'
+```
+
+3. 尝试 `GET` 请求
+
+```shell
+curl -H 'content-type: application/graphql' -X GET "http://127.0.0.1:9080/graphql?query=query getRepo { owner {name } repo {created}}" -g

Review comment:
       ```suggestion
   curl -H 'content-type: application/graphql' -X \
   GET "http://127.0.0.1:9080/graphql?query=query getRepo { owner {name } repo {created}}" -g
   ```

##########
File path: docs/en/latest/router-radixtree.md
##########
@@ -289,6 +291,34 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f
 }'
 ```
 
+We can verify GraphQL matches in the following two ways:
+
+1. GraphQL query strings
+
+```shell
+$ curl -H 'content-type: application/graphql' -X POST http://127.0.0.1:9080/graphql -d '

Review comment:
       Please refer to en modification




-- 
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