From 6653e90ad1ac2c75c8afbfc317cbee419235a5bc Mon Sep 17 00:00:00 2001 From: Oleg Artene Date: Fri, 30 Aug 2019 01:44:27 +0300 Subject: [PATCH 1/2] removed Python from ordered args example Python supports named arguments --- site/learn/Learn-Schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/learn/Learn-Schema.md b/site/learn/Learn-Schema.md index 40a5b7ced5..bb9e0cf12c 100644 --- a/site/learn/Learn-Schema.md +++ b/site/learn/Learn-Schema.md @@ -68,7 +68,7 @@ type Starship { } ``` -All arguments are named. Unlike languages like JavaScript and Python where functions take a list of ordered arguments, all arguments in GraphQL are passed by name specifically. In this case, the `length` field has one defined argument, `unit`. +All arguments are named. Unlike languages like JavaScript and PHP where functions take a list of ordered arguments, all arguments in GraphQL are passed by name specifically. In this case, the `length` field has one defined argument, `unit`. Arguments can be either required or optional. When an argument is optional, we can define a _default value_ - if the `unit` argument is not passed, it will be set to `METER` by default. From 29ace65bf6d23dcc90d36092b02788803cbb1b18 Mon Sep 17 00:00:00 2001 From: Oleg Artene Date: Fri, 30 Aug 2019 02:11:16 +0300 Subject: [PATCH 2/2] schema: made friends,appearsIn,starships required --- site/learn/Learn-Schema.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/site/learn/Learn-Schema.md b/site/learn/Learn-Schema.md index bb9e0cf12c..4479ffbafd 100644 --- a/site/learn/Learn-Schema.md +++ b/site/learn/Learn-Schema.md @@ -233,8 +233,8 @@ For example, you could have an interface `Character` that represents any charact interface Character { id: ID! name: String! - friends: [Character] - appearsIn: [Episode]! + friends: [Character!] + appearsIn: [Episode!]! } ``` @@ -246,17 +246,17 @@ For example, here are some types that might implement `Character`: type Human implements Character { id: ID! name: String! - friends: [Character] - appearsIn: [Episode]! - starships: [Starship] + friends: [Character!] + appearsIn: [Episode!]! + starships: [Starship!] totalCredits: Int } type Droid implements Character { id: ID! name: String! - friends: [Character] - appearsIn: [Episode]! + friends: [Character!] + appearsIn: [Episode!]! primaryFunction: String } ```