Skip to content

Commit 568d26f

Browse files
leebyronmagicmark
authored andcommitted
Editorial on grammar and semantics
1 parent 8be29ca commit 568d26f

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
@@ -268,6 +268,13 @@ SchemaExtension :
268268

269269
RootOperationTypeDefinition : OperationType : NamedType
270270

271+
SchemaCoordinate :
272+
- Name
273+
- Name . Name
274+
- Name . Name ( Name : )
275+
- @ Name
276+
- @ Name ( Name : )
277+
271278
Description : StringValue
272279

273280
TypeDefinition :

spec/Section 3 -- Type System.md

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

290-
**Definition**
291-
292-
SchemaCoordinate:
290+
SchemaCoordinate :
293291
- Name
294292
- Name . Name
295293
- Name . Name ( Name : )
296294
- @ Name
297295
- @ Name ( Name : )
298296

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

305302
**Semantics**
306303

307-
SchemaCoordinate: Name
304+
A schema coordinate's semantics assume they are interpreted in the context of
305+
a single GraphQL {schema}.
306+
307+
SchemaCoordinate : Name
308308
1. Let {typeName} be the value of the first {Name}.
309-
2. Return the type in the schema named {typeName}.
309+
2. Return the type in the {schema} named {typeName}.
310310

311-
SchemaCoordinate: Name . Name
311+
SchemaCoordinate : Name . Name
312312
1. Let {typeName} be the value of the first {Name}.
313-
2. Let {type} be the type in the schema named {typeName}.
313+
2. Let {type} be the type in the {schema} named {typeName}.
314314
3. If {type} is an Enum type:
315315
1. Let {enumValueName} be the value of the second {Name}.
316316
2. Return the enum value of {type} named {enumValueName}.
317317
4. Otherwise if {type} is an Input Object type:
318318
1. Let {inputFieldName} be the value of the second {Name}.
319319
2. Return the input field of {type} named {inputFieldName}.
320320
5. Otherwise:
321-
1. Assert: {type} must be an Object or Interface type.
321+
1. Assert {type} must be an Object or Interface type.
322322
2. Let {fieldName} be the value of the second {Name}.
323323
3. Return the field of {type} named {fieldName}.
324-
325-
SchemaCoordinate: Name . Name ( Name : )
324+
325+
SchemaCoordinate : Name . Name ( Name : )
326326
1. Let {typeName} be the value of the first {Name}.
327-
2. Let {type} be the type in the schema named {typeName}.
328-
3. Assert: {type} must be an Object or Interface type.
327+
2. Let {type} be the type in the {schema} named {typeName}.
328+
3. Assert {type} must be an Object or Interface type.
329329
4. Let {fieldName} be the value of the second {Name}.
330330
5. Let {field} be the field of {type} named {fieldName}.
331-
6. Assert: {field} must exist.
331+
6. Assert {field} must exist.
332332
7. Let {argumentName} be the value of the third {Name}.
333333
8. Return the argument of {field} named {argumentName}.
334334

335-
SchemaCoordinate: @ Name
335+
SchemaCoordinate : @ Name
336336
1. Let {directiveName} be the value of the first {Name}.
337-
2. Return the directive in the schema named {directiveName}.
337+
2. Return the directive in the {schema} named {directiveName}.
338338

339-
SchemaCoordinate: @ Name ( Name : )
339+
SchemaCoordinate : @ Name ( Name : )
340340
1. Let {directiveName} be the value of the first {Name}.
341-
2. Let {directive} be the directive in the schema named {directiveName}.
342-
3. Assert: {directive} must exist.
341+
2. Let {directive} be the directive in the {schema} named {directiveName}.
342+
3. Assert {directive} must exist.
343343
7. Let {argumentName} be the value of the second {Name}.
344-
8. Return the argument of {directive} named {argumentName}
344+
8. Return the argument of {directive} named {argumentName}.
345345

346346
**Examples**
347347

0 commit comments

Comments
 (0)