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

Guides-ConstructingTypes.md #50

Merged
merged 3 commits into from Aug 9, 2017
Merged

Conversation

hikerpig
Copy link

@hikerpig hikerpig commented Jul 28, 2017

close #21

@@ -6,11 +6,11 @@ permalink: /graphql-js/constructing-types/
next: /graphql-js/express-graphql/
---

For many apps, you can define a fixed schema when the application starts, and define it using GraphQL schema language. In some cases, it's useful to construct a schema programmatically. You can do this using the `GraphQLSchema` constructor.
对多数应用来说,你可以在开始运行的时候使用 GraphQL 模式语言声明固有的模式。但有些情况下,使用程序构建模式也很有用。你可使用 `GraphQLSchema` 构造函数来做这件事。
Copy link
Collaborator

Choose a reason for hiding this comment

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

schema 不翻译

@@ -112,6 +112,6 @@ app.listen(4000);
console.log('Running a GraphQL API server at localhost:4000/graphql');
```

When we use this method of creating the API, the root level resolvers are implemented on the `Query` and `Mutation` types rather than on a `root` object.
当我们使用这种方式构建 API 时,根解析器是构建在 `Query` `Mutation` 类型, 而不是 `root` 对象上的。
Copy link
Collaborator

Choose a reason for hiding this comment

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

第二个逗号是英文


This is particularly useful if you want to create a GraphQL schema automatically from something else, like a database schema. You might have a common format for something like creating and updating database records. This is also useful for implementing features like union types which don't map cleanly to ES6 classes and schema language.
这种方法在你想要通过一些手段(例如数据库模式)自动创建 GraphQL 模式时很有用。如此一来你就可以有些类似于创建和更改数据库记录的通用模板。还有,在实现类似集合类型(union types)这种没法轻易映射为 ES6 Class 或者纯模式语言实现的功能时,此方法也很有用。
Copy link
Collaborator

Choose a reason for hiding this comment

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

“有些”有歧义,改成“拥有一些”如何?

@hikerpig
Copy link
Author

修改完成,单独的“模式” 保留回 Schema, “Schema Language” 翻成“模式语言”,可否? @ydfzgyj

@ydfzgyj
Copy link
Collaborator

ydfzgyj commented Jul 31, 2017

修改完成,单独的“模式” 保留回 Schema, “Schema Language” 翻成“模式语言”,可否?

schema 不翻译主要是能翻译成模式的词太多,model、pattern 被翻译成模式的情况都很常见,我觉得“模式语言”还是会有混淆的问题,还是保留原词为好,虽然是有点奇怪……
其实我是觉得 schema 可以叫“图式”的,正好对应 Graph,不过之前讨论的时候其他同学觉得数据库里 Schema 这个词一般也不翻译,所以这样定下来,不知道你有没有更好的方法? @hikerpig

@hikerpig
Copy link
Author

hikerpig commented Aug 1, 2017

Schema 这个词我之前没有看到过相关的翻译,的确都是保留下来的,如果这份文档没有专门提出一个术语表而且保证用户一定会看到的话,还是保留 Schema 吧, 所以我这个问题的解决方案得是“Schema”语言了么...l @ydfzgyj

@ydfzgyj
Copy link
Collaborator

ydfzgyj commented Aug 2, 2017

如果你实在觉得“schema 语言”别扭的话,直接保留“schema language” 我也是可以接受的😂

@hikerpig
Copy link
Author

hikerpig commented Aug 2, 2017

没有找到更好的翻译之前还是保留 Schema Language 吧,之后大家有更好的认识以后统一替换掉 @ydfzgyj

@hikerpig
Copy link
Author

hikerpig commented Aug 2, 2017

把之前翻的 “数据库模式” 也改回 ‘数据库 Schema“ 了 @ydfzgyj

@jonirrings jonirrings changed the title 'Guides-ConstructingTypes' 翻译完成 Guides-ConstructingTypes.md Aug 4, 2017
@linhe0x0 linhe0x0 merged commit 97811b7 into xitu:zh-Hans Aug 9, 2017
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.

Guides-ConstructingTypes.md
3 participants