Skip to content
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

Merged
merged 3 commits into from
Aug 10, 2017
Merged

BestPractice-ServingOverHTTP.md #49

merged 3 commits into from
Aug 10, 2017

Conversation

ydfzgyj
Copy link
Collaborator

@ydfzgyj ydfzgyj commented Jul 28, 2017

close #5

Copy link
Collaborator

@jonirrings jonirrings left a 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 服务
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

通过 HTTP 提供服务?
出于什么考量省去了“提供”呢?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

省去了“通过”吧……我觉得应该没有歧义?

Copy link
Collaborator

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` 查询参数来控制哪一个应当执行。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

named我倾向于翻译作“具名”。

Copy link
Collaborator Author

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,那么您已经直接获得了这些支持。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈哈,我觉得我们需要统一“您”和“你”

Copy link
Collaborator Author

@ydfzgyj ydfzgyj Aug 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈……现在已经翻译了这么多篇,其他文章也得跟着统一呀
我这篇都是“您”,我觉得先这样吧,最后全部翻完的时候,再过一遍,这个问题可以先记下来

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯~~~

Copy link
Member

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:

Copy link
Collaborator Author

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend 在这更多是“推荐”而非“建议”,我是这么感觉的。只是"推销",而非“看上去需要修正”。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“这个问题需要修正”不应该用 advise 吗……不过这里似乎推荐是更好,那就改一下

jonirrings
jonirrings previously approved these changes Aug 3, 2017
Copy link
Collaborator

@jonirrings jonirrings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

初校 完成,待 复校

@jonirrings jonirrings changed the title BestPractice-ServingOverHTTP BestPractice-ServingOverHTTP.md Aug 4, 2017
## 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 请求都应被导向此入口端点。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『“资源”』中的标点符号使用全角替换。

Copy link
Collaborator Author

@ydfzgyj ydfzgyj Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你也是用的 Mac 吧,这里已经是全角的引号啦,只是因为弯引号“”在英文和中文字体采用的是同一个编码,在这种英文的网站上会优先使用英文的 SF 字体而不是中文的苹方,所以显示成半角的弯引号,你可以换一个字体比如冬青黑,就能看到变成全角的引号了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
它是这样的,目测不是字体的锅吧。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

就是字体的锅,因为现在英文很多地方也用这种弯引号而不是我们编程用的直引号",我也贴几张图吧,都是用控制台改 font-family 的效果:
default
这是冬青黑
heiti sc
这是以前默认的华文黑体

Copy link
Member

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,那么您已经直接获得了这些支持。
Copy link
Member

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:

@linhe0x0
Copy link
Member

@jonirrings 有空来看一下哈,待 merge 了。

@jonirrings
Copy link
Collaborator

jonirrings commented Aug 10, 2017

我这边看是没啥问题了@sqrthree

@linhe0x0
Copy link
Member

linhe0x0 commented Aug 10, 2017

那就统一使用『你』了?

@jonirrings
Copy link
Collaborator

嗯,统一用“你”吧

@linhe0x0 linhe0x0 merged commit 8c506f4 into xitu:zh-Hans Aug 10, 2017
@ydfzgyj ydfzgyj deleted the best-practice-serving-over-http branch August 10, 2017 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BestPractice-ServingOverHTTP.md
3 participants