Skip to content

Update Tutorial-PassingArguments.md #101

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

Merged
merged 2 commits into from
Nov 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions site/graphql-js/Tutorial-PassingArguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permalink: /graphql-js/passing-arguments/
next: /graphql-js/object-types/
---

就像 REST API 一样,在 GraphQL API 中,通常向入口端点传入参数,在 schema language 中定义参数,并自动进行类型检查。每一个参数必须有名字和数据类型。举个例子,在 [基础类型文档](/graphql-js/basic-types/) 中,我们定义了一个名为 `rollThreeDice` 的入口端点:
就像 REST API 一样,在 GraphQL API 中,通常向入口端点传入参数,在 schema language 中定义参数,并自动进行类型检查。每一个参数必须有名字和数据类型。举个例子,在 [基本类型文档](/graphql-js/basic-types/) 中,我们定义了一个名为 `rollThreeDice` 的入口端点:

```javascript
type Query {
Expand Down Expand Up @@ -127,4 +127,4 @@ fetch('/graphql', {

使用 `$dice` 和 `$sides` 作为 GraphQL 中的变量,我们无需在客户端对它们进行转义。

通过基础类型和参数传递,你可以定义任意你"能够"在 REST API 中定义的内容。但 GraphQL 支持更强大的查询。如果你学习了 [定义你自己的对象类型](/graphql-js/object-types/),你可以用单个 API 调用来代替多个 API 调用。
通过基本类型和参数传递,你可以定义任意你"能够"在 REST API 中定义的内容。但 GraphQL 支持更强大的查询。如果你学习了 [定义你自己的对象类型](/graphql-js/object-types/),你可以用单个 API 调用来代替多个 API 调用。