Skip to content

Commit 3a9e537

Browse files
leebyronbenjie
andauthored
Apply suggestions from code review
Co-authored-by: Benjie <[email protected]>
1 parent 63b0933 commit 3a9e537

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

spec/Appendix B -- Grammar Summary.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ TypeSystemDirectiveLocation : one of
414414
- `INPUT_OBJECT`
415415
- `INPUT_FIELD_DEFINITION`
416416

417+
## Schema Coordinate Syntax
418+
419+
Note: In order to be unique, schema coordinates do not permit {Ignored} lexical
420+
grammars.
417421
SchemaCoordinate :
418422

419423
- TypeCoordinate
@@ -431,6 +435,3 @@ ArgumentCoordinate : Name . Name ( Name : )
431435
DirectiveCoordinate : @ Name
432436

433437
DirectiveArgumentCoordinate : @ Name ( Name : )
434-
435-
Note: This grammar is unique. A _schema coordinate_ may not include any other
436-
tokens.

spec/Section 3 -- Type System.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,8 +2248,10 @@ DirectiveCoordinate : @ Name
22482248

22492249
DirectiveArgumentCoordinate : @ Name ( Name : )
22502250

2251-
Note: A _schema coordinate_ is defined with its own grammar and may not include
2252-
any other tokens.
2251+
Note: A _schema coordinate_ is defined with its own grammar that, unlike GraphQL
2252+
documents, excludes {Ignored} lexical grammars (see: [Lexical Analysis &
2253+
Syntactic Parse of a Schema Coordinate](
2254+
(#sec-Type-System.Schema-Coordinates.Lexical-Analysis-Syntactic-Parse-of-a-Schema-Coordinate)).
22532255

22542256
:: A _schema coordinate_ is a human readable string that uniquely identifies a
22552257
_schema element_ within a GraphQL Schema.
@@ -2277,9 +2279,10 @@ A _schema coordinate_ may refer to either a defined or built-in _schema
22772279
element_. For example, `String` and `@deprecated(reason:)` are both valid schema
22782280
coordinates which refer to built-in schema elements.
22792281

2280-
Note: Union members are not valid _schema coordinate_ as they reference existing
2281-
types in the schema. This preserves the uniqueness property of a _schema
2282-
coordinate_ as stated above.
2282+
Note: A union member references a type in the schema. A type in the schema is
2283+
identified by a {TypeCoordinate}. There is no schema coordinate which indicates
2284+
a union member; this preserves the uniqueness property of a _schema coordinate_
2285+
as stated above.
22832286

22842287
Note: A {SchemaCoordinate} is not a definition within a GraphQL {Document}, but
22852288
a separate standalone grammar, intended to be used by tools to reference types,
@@ -2290,12 +2293,18 @@ production.
22902293

22912294
**Lexical Analysis & Syntactic Parse of a Schema Coordinate**
22922295

2293-
The source text of a _schema coordinate_ is processed in the same way as that of
2294-
a GraphQL document, as laid out in the [Language](#sec-Language) section, with
2295-
the exception that only the subset of tokens as described in the grammar above
2296-
may be considered. A schema coordinate must therefore not contain whitespace,
2297-
line terminators, comments, commas, or a _Byte Order Mark_. This constraint
2298-
ensures that schema coordinates are both unambiguous and unique.
2296+
Similar to [GraphQL documents](#sec-Language), a schema coordinate is defined as
2297+
a syntactic grammar where terminal symbols are tokens (indivisible lexical
2298+
units). These tokens are defined in a lexical grammar which matches patterns of
2299+
source characters. The source text of a schema coordinate must be a sequence of
2300+
{SourceCharacter}. The character sequence must be described by a sequence of
2301+
{Token} lexical grammars. The lexical token sequence, must be described by a
2302+
single {SchemaCoordinate} syntactic grammar.
2303+
2304+
Unlike with GraphQL documents, {Ignored} lexical grammars are not permitted
2305+
within the character sequence; a schema coordinate must therefore not contain
2306+
whitespace, line terminators, comments, commas, or a _Byte Order Mark_. This
2307+
constraint ensures that schema coordinates are both unambiguous and unique.
22992308

23002309
**Resolving a Schema Coordinate**
23012310

0 commit comments

Comments
 (0)