Skip to content

Commit fc1ddca

Browse files
committed
restrict schema coordinates to a unique grammar
1 parent 4c39cda commit fc1ddca

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

spec/Appendix B -- Grammar Summary.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ Token ::
4343
- FloatValue
4444
- StringValue
4545

46-
Punctuator ::
47-
48-
- DotPunctuator
49-
- OtherPunctuator
50-
51-
DotPunctuator :: `.` [lookahead != {`.`, Digit}]
52-
53-
OtherPunctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
46+
Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
5447

5548
Name ::
5649

@@ -438,3 +431,6 @@ ArgumentCoordinate : Name . Name ( Name : )
438431
DirectiveCoordinate : @ Name
439432

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

spec/Section 2 -- Language.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,25 +176,12 @@ and is {Ignored}.
176176

177177
### Punctuators
178178

179-
Punctuator ::
180-
181-
- DotPunctuator
182-
- OtherPunctuator
183-
184-
DotPunctuator :: `.` [lookahead != {`.`, Digit}]
185-
186-
OtherPunctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
179+
Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
187180

188181
GraphQL documents include punctuation in order to describe structure. GraphQL is
189182
a data description language and not a programming language, therefore GraphQL
190183
lacks the punctuation often used to describe mathematical expressions.
191184

192-
The {`.`} punctuator must not be followed by a {`.`} or {Digit}. This ensures
193-
that the source {"..."} can only be interpreted as a single {`...`} and not
194-
three {`.`}. It also avoids any potential ambiguity with {FloatValue}. As an
195-
example the source {".123"} has no valid lexical representation (without this
196-
restriction it would have been interpreted as {`.`} followed by {IntValue}).
197-
198185
### Names
199186

200187
Name ::

spec/Section 3 -- Type System.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,9 @@ 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.
2253+
22512254
:: A _schema coordinate_ is a human readable string that uniquely identifies a
22522255
_schema element_ within a GraphQL Schema.
22532256

@@ -2289,10 +2292,10 @@ production.
22892292

22902293
The source text of a _schema coordinate_ is processed in the same way as that of
22912294
a GraphQL document, as laid out in the [Language](#sec-Language) section, with
2292-
the exception that {Ignored} tokens are disallowed. A schema coordinate must
2293-
therefore not contain whitespace, line terminators, comments, commas, or a _Byte
2294-
Order Mark_. This constraint ensures that schema coordinates are both
2295-
unambiguous and unique.
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.
22962299

22972300
**Resolving a Schema Coordinate**
22982301

0 commit comments

Comments
 (0)