-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BestPractice-ServingOverHTTP.md #49
BestPractice-ServingOverHTTP.md #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
细节待讨论
@@ -1,25 +1,25 @@ | |||
--- | |||
title: Serving over HTTP | |||
title: 提供 HTTP 服务 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
通过 HTTP 提供服务?
出于什么考量省去了“提供”呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
省去了“通过”吧……我觉得应该没有歧义?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
歧义不大。那我approve,等待下一个校对通过就merge。
|
||
``` | ||
http://myapi/graphql?query={me{name}} | ||
``` | ||
|
||
Query variables can be sent as a JSON-encoded string in an additional query parameter called `variables`. If the query contains several named operations, an `operationName` query parameter can be used to control which one should be executed. | ||
查询变量可以作为 JSON 编码的字符串发送到名为 `variables` 的附加查询参数中。如果查询包含多个命名操作,则可以使用一个 `operationName` 查询参数来控制哪一个应当执行。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
named我倾向于翻译作“具名”。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以的
|
||
If you're using express-graphql, you already get these behaviors for free. | ||
如果您使用的是 express-graphql,那么您已经直接获得了这些支持。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈,我觉得我们需要统一“您”和“你”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈……现在已经翻译了这么多篇,其他文章也得跟着统一呀
我这篇都是“您”,我觉得先这样吧,最后全部翻完的时候,再过一遍,这个问题可以先记下来
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我倾向于使用『你』,不然读着太客套了 。:stuck_out_tongue_closed_eyes:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈, @jonirrings 什么意见
@@ -82,4 +82,4 @@ app.use('/graphql', graphqlHTTP({ | |||
``` | |||
|
|||
## Node | |||
If you are using NodeJS, we recommend using either [express-graphql](https://github.com/graphql/express-graphql) or [graphql-server](https://github.com/apollostack/graphql-server). | |||
如果您正在使用 NodeJS,我们建议使用 [express-graphql](https://github.com/graphql/express-graphql) 或 [graphql-server](https://github.com/apollostack/graphql-server)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommend 在这更多是“推荐”而非“建议”,我是这么感觉的。只是"推销",而非“看上去需要修正”。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“这个问题需要修正”不应该用 advise 吗……不过这里似乎推荐是更好,那就改一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
初校 完成,待 复校
## URIs, Routes | ||
HTTP is commonly associated with REST, which uses "resources" as its core concept. In contrast, GraphQL's conceptual model is an entity graph. As a result, entities in GraphQL are not identified by URLs. Instead, a GraphQL server operates on a single URL/endpoint, usually `/graphql`, and all GraphQL requests for a given service should be directed at this endpoint. | ||
## URI 和路由 | ||
HTTP 通常与 REST 相关联,REST 使用“资源”作为其核心概念。相比之下,GraphQL 的概念模型是一个实体图。因此,GraphQL 中的实体无法通过 URL 识别。相反,GraphQL 服务器在单个 URL /入口端点(通常是 `/graphql`)上运行,并且所有提供服务的 GraphQL 请求都应被导向此入口端点。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
『“资源”』中的标点符号使用全角替换。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你也是用的 Mac 吧,这里已经是全角的引号啦,只是因为弯引号“”在英文和中文字体采用的是同一个编码,在这种英文的网站上会优先使用英文的 SF 字体而不是中文的苹方,所以显示成半角的弯引号,你可以换一个字体比如冬青黑,就能看到变成全角的引号了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好哒
|
||
If you're using express-graphql, you already get these behaviors for free. | ||
如果您使用的是 express-graphql,那么您已经直接获得了这些支持。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我倾向于使用『你』,不然读着太客套了 。:stuck_out_tongue_closed_eyes:
@jonirrings 有空来看一下哈,待 merge 了。 |
我这边看是没啥问题了@sqrthree |
那就统一使用『你』了? |
嗯,统一用“你”吧 |
close #5