Skip to content

Commit 7b75489

Browse files
committed
Revert "Use :: syntax for enum values"
This reverts commit 1cbad5d.
1 parent ff1ccb4 commit 7b75489

File tree

3 files changed

+19
-49
lines changed

3 files changed

+19
-49
lines changed

spec/Appendix B -- Grammar Summary.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,12 @@ Token ::
4545

4646
Punctuator ::
4747

48-
- ColonPunctuator
4948
- DotPunctuator
5049
- OtherPunctuator
5150

52-
ColonPunctuator :: `:` [lookahead != {`:`}]
53-
5451
DotPunctuator :: `.` [lookahead != {`.`, Digit}]
5552

56-
OtherPunctuator :: one of ! $ & ( ) ... :: = @ [ ] { | }
53+
OtherPunctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
5754

5855
Name ::
5956

@@ -426,20 +423,17 @@ TypeSystemDirectiveLocation : one of
426423
SchemaCoordinate :
427424

428425
- TypeCoordinate
429-
- FieldCoordinate
426+
- MemberCoordinate
430427
- ArgumentCoordinate
431-
- ValueCoordinate
432428
- DirectiveCoordinate
433429
- DirectiveArgumentCoordinate
434430

435431
TypeCoordinate : Name
436432

437-
FieldCoordinate : Name . Name
433+
MemberCoordinate : Name . Name
438434

439435
ArgumentCoordinate : Name . Name ( Name : )
440436

441-
ValueCoordinate : Name :: Name
442-
443437
DirectiveCoordinate : @ Name
444438

445439
DirectiveArgumentCoordinate : @ Name ( Name : )

spec/Section 2 -- Language.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,17 @@ and is {Ignored}.
178178

179179
Punctuator ::
180180

181-
- ColonPunctuator
182181
- DotPunctuator
183182
- OtherPunctuator
184183

185-
ColonPunctuator :: `:` [lookahead != {`:`}]
186-
187184
DotPunctuator :: `.` [lookahead != {`.`, Digit}]
188185

189-
OtherPunctuator :: one of ! $ & ( ) ... :: = @ [ ] { | }
186+
OtherPunctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
190187

191188
GraphQL documents include punctuation in order to describe structure. GraphQL is
192189
a data description language and not a programming language, therefore GraphQL
193190
lacks the punctuation often used to describe mathematical expressions.
194191

195-
The {`:`} punctuator must not be followed by a {`:`}. This ensures that the
196-
source {"::"} can only be interpreted as a single {`::`} and not two {`:`}.
197-
198192
The {`.`} punctuator must not be followed by a {`.`} or {Digit}. This ensures
199193
that the source {"..."} can only be interpreted as a single {`...`} and not
200194
three {`.`}. It also avoids any potential ambiguity with {FloatValue}. As an

spec/Section 3 -- Type System.md

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,20 +2174,17 @@ scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122")
21742174
SchemaCoordinate :
21752175

21762176
- TypeCoordinate
2177-
- FieldCoordinate
2177+
- MemberCoordinate
21782178
- ArgumentCoordinate
2179-
- ValueCoordinate
21802179
- DirectiveCoordinate
21812180
- DirectiveArgumentCoordinate
21822181

21832182
TypeCoordinate : Name
21842183

2185-
FieldCoordinate : Name . Name
2184+
MemberCoordinate : Name . Name
21862185

21872186
ArgumentCoordinate : Name . Name ( Name : )
21882187

2189-
ValueCoordinate : Name :: Name
2190-
21912188
DirectiveCoordinate : @ Name
21922189

21932190
DirectiveArgumentCoordinate : @ Name ( Name : )
@@ -2198,16 +2195,6 @@ _schema element_ within a GraphQL Schema.
21982195
:: A _schema element_ can be a named type, a field, an input field, an enum
21992196
value, a field argument, a directive, or a directive argument.
22002197

2201-
:: The _containing element_ of a _schema element_ is the schema element with one
2202-
fewer {Name} token that syntactically contains it. For example:
2203-
2204-
- The containing element of an {ArgumentCoordinate} or
2205-
{DirectiveArgumentCoordinate} is the corresponding {FieldCoordinate} or
2206-
{DirectiveCoordinate} respectively.
2207-
- The containing element of a {FieldCoordinate} or {ValueCoordinate} is its
2208-
containing {TypeCoordinate}.
2209-
- {TypeCoordinate} and {DirectiveCoordinate} have no containing element.
2210-
22112198
A _schema coordinate_ is always unique. Each _schema element_ can be referenced
22122199
by exactly one possible schema coordinate.
22132200

@@ -2233,27 +2220,31 @@ production.
22332220
To refer to a _schema element_, a _schema coordinate_ must be interpreted in the
22342221
context of a GraphQL {schema}.
22352222

2236-
If the _schema element_ cannot be found, and either it has no _containing
2237-
element_ or its _containing element_ exists and is of the expected type, the
2238-
resolve function returns {null}. Otherwise, an error is raised.
2223+
If the _schema element_ cannot be found, the resolve function will not yield a
2224+
value (without raising an error). However, an error will be raised if any
2225+
non-leaf nodes within a _schema coordinate_ cannot be found in the {schema}.
22392226

22402227
TypeCoordinate : Name
22412228

22422229
1. Let {typeName} be the value of {Name}.
22432230
2. Return the type in the {schema} named {typeName}, or {null} if no such type
22442231
exists.
22452232

2246-
FieldCoordinate : Name . Name
2233+
MemberCoordinate : Name . Name
22472234

22482235
1. Let {typeName} be the value of the first {Name}.
22492236
2. Let {type} be the type in the {schema} named {typeName}.
2250-
3. Assert: {type} must exist, and must be an Input Object, Object or Interface
2251-
type.
2252-
4. If {type} is an Input Object type:
2237+
3. Assert: {type} must exist, and must be an Enum, Input Object, Object or
2238+
Interface type.
2239+
4. If {type} is an Enum type:
2240+
1. Let {enumValueName} be the value of the second {Name}.
2241+
2. Return the enum value of {type} named {enumValueName}, or {null} if no
2242+
such value exists.
2243+
5. Otherwise, if {type} is an Input Object type:
22532244
1. Let {inputFieldName} be the value of the second {Name}.
22542245
2. Return the input field of {type} named {inputFieldName}, or {null} if no
22552246
such input field exists.
2256-
5. Otherwise:
2247+
6. Otherwise:
22572248
1. Let {fieldName} be the value of the second {Name}.
22582249
2. Return the field of {type} named {fieldName}, or {null} if no such field
22592250
exists.
@@ -2270,15 +2261,6 @@ ArgumentCoordinate : Name . Name ( Name : )
22702261
8. Return the argument of {field} named {fieldArgumentName}, or {null} if no
22712262
such argument exists.
22722263

2273-
ValueCoordinate : Name :: Name
2274-
2275-
1. Let {typeName} be the value of the first {Name}.
2276-
2. Let {type} be the type in the {schema} named {typeName}.
2277-
3. Assert: {type} must exist, and must be an Enum type.
2278-
4. Let {enumValueName} be the value of the second {Name}.
2279-
5. Return the enum value of {type} named {enumValueName}, or {null} if no such
2280-
value exists.
2281-
22822264
DirectiveCoordinate : @ Name
22832265

22842266
1. Let {directiveName} be the value of {Name}.
@@ -2301,8 +2283,8 @@ DirectiveArgumentCoordinate : @ Name ( Name : )
23012283
| Named Type | `Business` | `Business` type |
23022284
| Field | `Business.name` | `name` field on the `Business` type |
23032285
| Input Field | `SearchCriteria.filter` | `filter` input field on the `SearchCriteria` input object type |
2286+
| Enum Value | `SearchFilter.OPEN_NOW` | `OPEN_NOW` value of the `SearchFilter` enum |
23042287
| Field Argument | `Query.searchBusiness(criteria:)` | `criteria` argument on the `searchBusiness` field on the `Query` type |
2305-
| Enum Value | `SearchFilter::OPEN_NOW` | `OPEN_NOW` value of the `SearchFilter` enum |
23062288
| Directive | `@private` | `@private` directive |
23072289
| Directive Argument | `@private(scope:)` | `scope` argument on the `@private` directive |
23082290

0 commit comments

Comments
 (0)