Skip to content

Commit 7fb6007

Browse files
committed
Revert "Use :: syntax for enum values"
This reverts commit 1cbad5d.
1 parent 2c8aec8 commit 7fb6007

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

@@ -429,20 +426,17 @@ TypeSystemDirectiveLocation : one of
429426
SchemaCoordinate :
430427

431428
- TypeCoordinate
432-
- FieldCoordinate
429+
- MemberCoordinate
433430
- ArgumentCoordinate
434-
- ValueCoordinate
435431
- DirectiveCoordinate
436432
- DirectiveArgumentCoordinate
437433

438434
TypeCoordinate : Name
439435

440-
FieldCoordinate : Name . Name
436+
MemberCoordinate : Name . Name
441437

442438
ArgumentCoordinate : Name . Name ( Name : )
443439

444-
ValueCoordinate : Name :: Name
445-
446440
DirectiveCoordinate : @ Name
447441

448442
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
@@ -2233,20 +2233,17 @@ scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122")
22332233
SchemaCoordinate :
22342234

22352235
- TypeCoordinate
2236-
- FieldCoordinate
2236+
- MemberCoordinate
22372237
- ArgumentCoordinate
2238-
- ValueCoordinate
22392238
- DirectiveCoordinate
22402239
- DirectiveArgumentCoordinate
22412240

22422241
TypeCoordinate : Name
22432242

2244-
FieldCoordinate : Name . Name
2243+
MemberCoordinate : Name . Name
22452244

22462245
ArgumentCoordinate : Name . Name ( Name : )
22472246

2248-
ValueCoordinate : Name :: Name
2249-
22502247
DirectiveCoordinate : @ Name
22512248

22522249
DirectiveArgumentCoordinate : @ Name ( Name : )
@@ -2257,16 +2254,6 @@ _schema element_ within a GraphQL Schema.
22572254
:: A _schema element_ can be a named type, a field, an input field, an enum
22582255
value, a field argument, a directive, or a directive argument.
22592256

2260-
:: The _containing element_ of a _schema element_ is the schema element with one
2261-
fewer {Name} token that syntactically contains it. For example:
2262-
2263-
- The containing element of an {ArgumentCoordinate} or
2264-
{DirectiveArgumentCoordinate} is the corresponding {FieldCoordinate} or
2265-
{DirectiveCoordinate} respectively.
2266-
- The containing element of a {FieldCoordinate} or {ValueCoordinate} is its
2267-
containing {TypeCoordinate}.
2268-
- {TypeCoordinate} and {DirectiveCoordinate} have no containing element.
2269-
22702257
A _schema coordinate_ is always unique. Each _schema element_ can be referenced
22712258
by exactly one possible schema coordinate.
22722259

@@ -2292,27 +2279,31 @@ production.
22922279
To refer to a _schema element_, a _schema coordinate_ must be interpreted in the
22932280
context of a GraphQL {schema}.
22942281

2295-
If the _schema element_ cannot be found, and either it has no _containing
2296-
element_ or its _containing element_ exists and is of the expected type, the
2297-
resolve function returns {null}. Otherwise, an error is raised.
2282+
If the _schema element_ cannot be found, the resolve function will not yield a
2283+
value (without raising an error). However, an error will be raised if any
2284+
non-leaf nodes within a _schema coordinate_ cannot be found in the {schema}.
22982285

22992286
TypeCoordinate : Name
23002287

23012288
1. Let {typeName} be the value of {Name}.
23022289
2. Return the type in the {schema} named {typeName}, or {null} if no such type
23032290
exists.
23042291

2305-
FieldCoordinate : Name . Name
2292+
MemberCoordinate : Name . Name
23062293

23072294
1. Let {typeName} be the value of the first {Name}.
23082295
2. Let {type} be the type in the {schema} named {typeName}.
2309-
3. Assert: {type} must exist, and must be an Input Object, Object or Interface
2310-
type.
2311-
4. If {type} is an Input Object type:
2296+
3. Assert: {type} must exist, and must be an Enum, Input Object, Object or
2297+
Interface type.
2298+
4. If {type} is an Enum type:
2299+
1. Let {enumValueName} be the value of the second {Name}.
2300+
2. Return the enum value of {type} named {enumValueName}, or {null} if no
2301+
such value exists.
2302+
5. Otherwise, if {type} is an Input Object type:
23122303
1. Let {inputFieldName} be the value of the second {Name}.
23132304
2. Return the input field of {type} named {inputFieldName}, or {null} if no
23142305
such input field exists.
2315-
5. Otherwise:
2306+
6. Otherwise:
23162307
1. Let {fieldName} be the value of the second {Name}.
23172308
2. Return the field of {type} named {fieldName}, or {null} if no such field
23182309
exists.
@@ -2329,15 +2320,6 @@ ArgumentCoordinate : Name . Name ( Name : )
23292320
8. Return the argument of {field} named {fieldArgumentName}, or {null} if no
23302321
such argument exists.
23312322

2332-
ValueCoordinate : Name :: Name
2333-
2334-
1. Let {typeName} be the value of the first {Name}.
2335-
2. Let {type} be the type in the {schema} named {typeName}.
2336-
3. Assert: {type} must exist, and must be an Enum type.
2337-
4. Let {enumValueName} be the value of the second {Name}.
2338-
5. Return the enum value of {type} named {enumValueName}, or {null} if no such
2339-
value exists.
2340-
23412323
DirectiveCoordinate : @ Name
23422324

23432325
1. Let {directiveName} be the value of {Name}.
@@ -2360,8 +2342,8 @@ DirectiveArgumentCoordinate : @ Name ( Name : )
23602342
| Named Type | `Business` | `Business` type |
23612343
| Field | `Business.name` | `name` field on the `Business` type |
23622344
| Input Field | `SearchCriteria.filter` | `filter` input field on the `SearchCriteria` input object type |
2345+
| Enum Value | `SearchFilter.OPEN_NOW` | `OPEN_NOW` value of the `SearchFilter` enum |
23632346
| Field Argument | `Query.searchBusiness(criteria:)` | `criteria` argument on the `searchBusiness` field on the `Query` type |
2364-
| Enum Value | `SearchFilter::OPEN_NOW` | `OPEN_NOW` value of the `SearchFilter` enum |
23652347
| Directive | `@private` | `@private` directive |
23662348
| Directive Argument | `@private(scope:)` | `scope` argument on the `@private` directive |
23672349

0 commit comments

Comments
 (0)