Skip to content

Commit 4ca1b15

Browse files
committed
Editorial on grammar and semantics
1 parent a03513b commit 4ca1b15

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

spec/Appendix B -- Grammar Summary.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ SchemaExtension :
235235

236236
RootOperationTypeDefinition : OperationType : NamedType
237237

238+
SchemaCoordinate :
239+
- Name
240+
- Name . Name
241+
- Name . Name ( Name : )
242+
- @ Name
243+
- @ Name ( Name : )
244+
238245
Description : StringValue
239246

240247
TypeDefinition :

spec/Section 3 -- Type System.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -256,61 +256,61 @@ Schema extensions have the potential to be invalid if incorrectly defined.
256256
Schema Coordinates are human readable strings that uniquely identify a specific
257257
type, field, argument, enum value, or directive defined in a GraphQL Schema.
258258

259-
**Definition**
260-
261-
SchemaCoordinate:
259+
SchemaCoordinate :
262260
- Name
263261
- Name . Name
264262
- Name . Name ( Name : )
265263
- @ Name
266264
- @ Name ( Name : )
267265

268-
Note: The `SchemaCoordinate` syntax is not part of a GraphQL Document. Schema
269-
Coordinates are a separate syntax, intended to be used by tooling when
270-
referencing types and fields or other schema elements. (For example, a server
271-
that wishes to keep track of the number of times fields have been accessed may
272-
use their Schema Coordinate as the lookup key.)
266+
Note: A {SchemaCoordinate} is not a definition within a GraphQL {Document}.
267+
Schema coordinates are a separate syntax, intended to be used by tools to
268+
reference types and fields or other schema elements. For example: within
269+
documentation, or as lookup keys a service uses to track usage frequency.
273270

274271
**Semantics**
275272

276-
SchemaCoordinate: Name
273+
A schema coordinate's semantics assume they are interpreted in the context of
274+
a single GraphQL {schema}.
275+
276+
SchemaCoordinate : Name
277277
1. Let {typeName} be the value of the first {Name}.
278-
2. Return the type in the schema named {typeName}.
278+
2. Return the type in the {schema} named {typeName}.
279279

280-
SchemaCoordinate: Name . Name
280+
SchemaCoordinate : Name . Name
281281
1. Let {typeName} be the value of the first {Name}.
282-
2. Let {type} be the type in the schema named {typeName}.
282+
2. Let {type} be the type in the {schema} named {typeName}.
283283
3. If {type} is an Enum type:
284284
1. Let {enumValueName} be the value of the second {Name}.
285285
2. Return the enum value of {type} named {enumValueName}.
286286
4. Otherwise if {type} is an Input Object type:
287287
1. Let {inputFieldName} be the value of the second {Name}.
288288
2. Return the input field of {type} named {inputFieldName}.
289289
5. Otherwise:
290-
1. Assert: {type} must be an Object or Interface type.
290+
1. Assert {type} must be an Object or Interface type.
291291
2. Let {fieldName} be the value of the second {Name}.
292292
3. Return the field of {type} named {fieldName}.
293-
294-
SchemaCoordinate: Name . Name ( Name : )
293+
294+
SchemaCoordinate : Name . Name ( Name : )
295295
1. Let {typeName} be the value of the first {Name}.
296-
2. Let {type} be the type in the schema named {typeName}.
297-
3. Assert: {type} must be an Object or Interface type.
296+
2. Let {type} be the type in the {schema} named {typeName}.
297+
3. Assert {type} must be an Object or Interface type.
298298
4. Let {fieldName} be the value of the second {Name}.
299299
5. Let {field} be the field of {type} named {fieldName}.
300-
6. Assert: {field} must exist.
300+
6. Assert {field} must exist.
301301
7. Let {argumentName} be the value of the third {Name}.
302302
8. Return the argument of {field} named {argumentName}.
303303

304-
SchemaCoordinate: @ Name
304+
SchemaCoordinate : @ Name
305305
1. Let {directiveName} be the value of the first {Name}.
306-
2. Return the directive in the schema named {directiveName}.
306+
2. Return the directive in the {schema} named {directiveName}.
307307

308-
SchemaCoordinate: @ Name ( Name : )
308+
SchemaCoordinate : @ Name ( Name : )
309309
1. Let {directiveName} be the value of the first {Name}.
310-
2. Let {directive} be the directive in the schema named {directiveName}.
311-
3. Assert: {directive} must exist.
310+
2. Let {directive} be the directive in the {schema} named {directiveName}.
311+
3. Assert {directive} must exist.
312312
7. Let {argumentName} be the value of the second {Name}.
313-
8. Return the argument of {directive} named {argumentName}
313+
8. Return the argument of {directive} named {argumentName}.
314314

315315
**Examples**
316316

0 commit comments

Comments
 (0)