Skip to content

Commit dc1374d

Browse files
magicmarkbenjie
andauthored
Apply benjie's suggestions from code review
Co-authored-by: Benjie <[email protected]>
1 parent a52e312 commit dc1374d

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

spec/Section 3 -- Type System.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,9 +2217,7 @@ non-leaf nodes within a _schema coordinate_ cannot be found in the {schema}.
22172217
SchemaCoordinate : Name
22182218

22192219
1. Let {typeName} be the value of {Name}.
2220-
2. Let {type} be the type in the {schema} named {typeName}.
2221-
3. If {type} does not exist, return {null}.
2222-
4. Return {type}.
2220+
2. Return the type in the {schema} named {typeName}, or {null} if no such type exists.
22232221

22242222
SchemaCoordinate : Name . Name
22252223

@@ -2228,20 +2226,14 @@ SchemaCoordinate : Name . Name
22282226
3. Assert: {type} must exist.
22292227
4. If {type} is an Enum type:
22302228
1. Let {enumValueName} be the value of the second {Name}.
2231-
2. Let {enumValue} be the enum value of {type} named {enumValueName}.
2232-
3. If {enumValue} does not exist, return {null}.
2233-
4. Return {enumValue}.
2229+
2. Return the enum value of {type} named {enumValueName}, or {null} if no such value exists.
22342230
5. Otherwise, if {type} is an Input Object type:
22352231
1. Let {inputFieldName} be the value of the second {Name}.
2236-
2. Let {inputField} be the input field of {type} named {inputFieldName}.
2237-
3. If {inputField} does not exist, return {null}.
2238-
4. Return {inputField}.
2232+
2. Return the input field of {type} named {inputFieldName}, or {null} if no such input field exists.
22392233
6. Otherwise:
22402234
1. Assert: {type} must be an Object or Interface type.
22412235
2. Let {fieldName} be the value of the second {Name}.
2242-
3. Let {field} be the field of {type} named {fieldName}.
2243-
4. If {field} does not exist, return {null}.
2244-
5. Return {field}.
2236+
3. Return the field of {type} named {fieldName}, or {null} if no such field exists.
22452237

22462238
SchemaCoordinate : Name . Name ( Name : )
22472239

@@ -2253,27 +2245,21 @@ SchemaCoordinate : Name . Name ( Name : )
22532245
6. Let {field} be the field of {type} named {fieldName}.
22542246
7. Assert: {field} must exist.
22552247
8. Let {fieldArgumentName} be the value of the third {Name}.
2256-
9. Let {fieldArgument} be the argument of {field} named {fieldArgumentName}.
2257-
10. If {fieldArgument} does not exist, return {null}.
2258-
11. Return {fieldArgument}.
2248+
9. Return the argument of {field} named {fieldArgumentName}, or {null} if no such argument exists.
22592249

22602250
SchemaCoordinate : @ Name
22612251

22622252
1. Let {directiveName} be the value of the first {Name}.
2263-
2. Let {directive} be the directive in the {schema} named {directiveName}.
2264-
3. If {directive} does not exist, return {null}.
2265-
4. Return {directive}.
2253+
2. Return the directive in the {schema} named {directiveName}, or {null} if no such directive exists.
22662254

22672255
SchemaCoordinate : @ Name ( Name : )
22682256

22692257
1. Let {directiveName} be the value of the first {Name}.
22702258
2. Let {directive} be the directive in the {schema} named {directiveName}.
22712259
3. Assert: {directive} must exist.
22722260
4. Let {directiveArgumentName} be the value of the second {Name}.
2273-
5. Let {directiveArgument} be the argument of {directive} named
2274-
{directiveArgumentName}.
2275-
6. If {directiveArgument} does not exist, return {null}.
2276-
7. Return {directiveArgument}.
2261+
5. Return the argument of {directive} named
2262+
{directiveArgumentName}, or {null} if no such argument exists.
22772263

22782264
**Examples**
22792265

0 commit comments

Comments
 (0)