Skip to content

Commit a77383a

Browse files
committed
Change syntax to use asterisk again
1 parent 858d409 commit a77383a

4 files changed

+33
-28
lines changed

spec/Appendix B -- Grammar Summary.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Token ::
4343
- FloatValue
4444
- StringValue
4545

46-
Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
46+
Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } \*
4747

4848
Name ::
4949

@@ -234,6 +234,11 @@ NonNullType :
234234
- NamedType !
235235
- ListType !
236236

237+
SemanticNonNullType :
238+
239+
- NamedType \*
240+
- ListType \*
241+
237242
Directives[Const] : Directive[?Const]+
238243

239244
Directive[Const] : @ Name Arguments[?Const]?

spec/Section 2 -- Language.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ and is {Ignored}.
176176

177177
### Punctuators
178178

179-
Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
179+
Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } \*
180180

181181
GraphQL documents include punctuation in order to describe structure. GraphQL is
182182
a data description language and not a programming language, therefore GraphQL
@@ -1241,8 +1241,8 @@ NonNullType :
12411241

12421242
SemanticNonNullType :
12431243

1244-
- ! NamedType
1245-
- ! ListType
1244+
- NamedType \*
1245+
- ListType \*
12461246

12471247
GraphQL describes the types of data expected by arguments and variables. Input
12481248
types may be lists of another input type, or a non-null variant of any other

spec/Section 3 -- Type System.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -1915,8 +1915,8 @@ _unless_ accompanied by a _field error_.
19151915

19161916
The Semantic-Non-Null type wraps an underlying type, and this type acts
19171917
identically to that wrapped type, with the exception that {null} will result in
1918-
a field error being raised. A leading exclamation mark is used to denote a
1919-
field that uses a Semantic-Non-Null type like this: `name: !String`.
1918+
a field error being raised. A trailing asterisk is used to denote a field that
1919+
uses a Semantic-Non-Null type like this: `name: String*`.
19201920

19211921
Semantic-Non-Null types are only valid for use as an _output type_; they must
19221922
not be used as an _input type_.
@@ -1955,7 +1955,7 @@ The List and Semantic-Non-Null wrapping types can compose, representing more
19551955
complex types. The rules for result coercion of Lists and Semantic-Non-Null
19561956
types apply in a recursive fashion.
19571957

1958-
For example if the inner item type of a List is Semantic-Non-Null (e.g. `[!T]`),
1958+
For example if the inner item type of a List is Semantic-Non-Null (e.g. `[T*]`),
19591959
then that List may not contain any {null} items unless associated field errors
19601960
were raised. However if the inner type of a Semantic-Non-Null is a List (e.g.
19611961
`![T]`), then {null} is not accepted without an accompanying field error being
@@ -1965,26 +1965,26 @@ Following are examples of result coercion with various types and values:
19651965

19661966
| Expected Type | Internal Value | Coerced Result |
19671967
| ------------- | --------------- | ------------------------------------------- |
1968-
| `![Int]` | `[1, 2, 3]` | `[1, 2, 3]` |
1969-
| `![Int]` | `null` | `null` (With logged coercion error) |
1970-
| `![Int]` | `[1, 2, null]` | `[1, 2, null]` |
1971-
| `![Int]` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
1972-
| `![Int!]` | `[1, 2, 3]` | `[1, 2, 3]` |
1973-
| `![Int!]` | `null` | `null` (With logged coercion error) |
1974-
| `![Int!]` | `[1, 2, null]` | `null` (With logged coercion error) |
1975-
| `![Int!]` | `[1, 2, Error]` | `null` (With logged error) |
1976-
| `[!Int]` | `[1, 2, 3]` | `[1, 2, 3]` |
1977-
| `[!Int]` | `null` | `null` |
1978-
| `[!Int]` | `[1, 2, null]` | `[1, 2, null]` (With logged coercion error) |
1979-
| `[!Int]` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
1980-
| `[!Int]!` | `[1, 2, 3]` | `[1, 2, 3]` |
1981-
| `[!Int]!` | `null` | Error: Value cannot be null |
1982-
| `[!Int]!` | `[1, 2, null]` | `[1, 2, null]` (With logged coercion error) |
1983-
| `[!Int]!` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
1984-
| `![!Int]` | `[1, 2, 3]` | `[1, 2, 3]` |
1985-
| `![!Int]` | `null` | `null` (With logged coercion error) |
1986-
| `![!Int]` | `[1, 2, null]` | `[1, 2, null]` (With logged coercion error) |
1987-
| `![!Int]` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
1968+
| `[Int]*` | `[1, 2, 3]` | `[1, 2, 3]` |
1969+
| `[Int]*` | `null` | `null` (With logged coercion error) |
1970+
| `[Int]*` | `[1, 2, null]` | `[1, 2, null]` |
1971+
| `[Int]*` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
1972+
| `[Int!]*` | `[1, 2, 3]` | `[1, 2, 3]` |
1973+
| `[Int!]*` | `null` | `null` (With logged coercion error) |
1974+
| `[Int!]*` | `[1, 2, null]` | `null` (With logged coercion error) |
1975+
| `[Int!]*` | `[1, 2, Error]` | `null` (With logged error) |
1976+
| `[Int*]` | `[1, 2, 3]` | `[1, 2, 3]` |
1977+
| `[Int*]` | `null` | `null` |
1978+
| `[Int*]` | `[1, 2, null]` | `[1, 2, null]` (With logged coercion error) |
1979+
| `[Int*]` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
1980+
| `[Int*]!` | `[1, 2, 3]` | `[1, 2, 3]` |
1981+
| `[Int*]!` | `null` | Error: Value cannot be null |
1982+
| `[Int*]!` | `[1, 2, null]` | `[1, 2, null]` (With logged coercion error) |
1983+
| `[Int*]!` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
1984+
| `[Int*]*` | `[1, 2, 3]` | `[1, 2, 3]` |
1985+
| `[Int*]*` | `null` | `null` (With logged coercion error) |
1986+
| `[Int*]*` | `[1, 2, null]` | `[1, 2, null]` (With logged coercion error) |
1987+
| `[Int*]*` | `[1, 2, Error]` | `[1, 2, null]` (With logged error) |
19881988

19891989
## Directives
19901990

spec/Section 4 -- Introspection.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ RecursivelyStripSemanticNonNullTypes(type):
461461
- Otherwise, return {type}.
462462

463463
Note: This algorithm recursively removes all Semantic-Non-Null type wrappers
464-
(e.g. `![[!Int]!]` would become `[[Int]!]`). This is to support legacy clients:
464+
(e.g. `[[Int*]!]*` would become `[[Int]!]`). This is to support legacy clients:
465465
they can safely treat a Semantic-Non-Null type as the underlying nullable type.
466466

467467
### The \_\_InputValue Type

0 commit comments

Comments
 (0)