@@ -1859,7 +1859,7 @@ non-null input type as invalid.
1859
1859
**Type Validation **
1860
1860
1861
1861
1. A Non -Null type must not wrap another Non -Null type .
1862
- 1. A Non -Null type must not wrap a Null - Only - On - Error type .
1862
+ 1. A Non -Null type must not wrap a Semantic - Non - Null type .
1863
1863
1864
1864
### Combining List and Non-Null
1865
1865
@@ -1893,82 +1893,82 @@ Following are examples of result coercion with various types and values:
1893
1893
| `[Int !]!` | `[1, 2, null ]` | Error : Item cannot be null |
1894
1894
| `[Int !]!` | `[1, 2, Error ]` | Error : Error occurred in item |
1895
1895
1896
- ## Null-Only-On-Error
1896
+ ## Semantic-Non-Null
1897
1897
1898
- The GraphQL Null - Only - On - Error type is an alternative to the GraphQL Non -Null
1898
+ The GraphQL Semantic - Non - Null type is an alternative to the GraphQL Non -Null
1899
1899
type to disallow null unless accompanied by a field error . This type wraps an
1900
1900
underlying type , and this type acts identically to that wrapped type , with the
1901
- exception that {null } will result in a field error being raised . A trailing
1902
- asterisk is used to denote a field that uses a Null - Only - On - Error type like
1903
- this : `name : String * `.
1901
+ exception that {null } will result in a field error being raised . A leading
1902
+ exclamation mark is used to denote a field that uses a Semantic - Non - Null type
1903
+ like this : `name : ! String `.
1904
1904
1905
- Null - Only - On - Error types are only valid for use as an _output type_ ; they must
1905
+ Semantic - Non - Null types are only valid for use as an _output type_ ; they must
1906
1906
not be used as an _input type_ .
1907
1907
1908
1908
**Nullable vs . Optional **
1909
1909
1910
- Fields that return Null - Only - On - Error types will never return the value {null }
1911
- if queried _unless_ an error has been logged for that field .
1910
+ Fields that return Semantic - Non - Null types will never return the value {null } if
1911
+ queried _unless_ an error has been logged for that field .
1912
1912
1913
1913
**Result Coercion **
1914
1914
1915
- To coerce the result of a Null - Only - On - Error type , the coercion of the wrapped
1915
+ To coerce the result of a Semantic - Non - Null type , the coercion of the wrapped
1916
1916
type should be performed . If that result was not {null }, then the result of
1917
- coercing the Null - Only - On - Error type is that result . If that result was {null },
1917
+ coercing the Semantic - Non - Null type is that result . If that result was {null },
1918
1918
then a _field error_ must be raised .
1919
1919
1920
- Note : When a _field error_ is raised on a Null - Only - On - Error value , the error
1920
+ Note : When a _field error_ is raised on a Semantic - Non - Null value , the error
1921
1921
does not propagate to the parent field , instead {null } is used for the value .
1922
1922
For more information on this process , see
1923
1923
[Handling Field Errors ](#sec-Handling-Field-Errors) within the Execution
1924
1924
section.
1925
1925
1926
1926
**Input Coercion**
1927
1927
1928
- Null-Only-On-Error types are never valid inputs.
1928
+ Semantic-Non-Null types are never valid inputs.
1929
1929
1930
1930
**Type Validation**
1931
1931
1932
- 1. A Null-Only-On-Error type must wrap an _output type_.
1933
- 1. A Null-Only-On-Error type must not wrap another Null-Only-On-Error type.
1934
- 1. A Null-Only-On-Error type must not wrap a Non-Null type.
1932
+ 1. A Semantic-Non-Null type must wrap an _output type_.
1933
+ 1. A Semantic-Non-Null type must not wrap another Semantic-Non-Null type.
1934
+ 1. A Semantic-Non-Null type must not wrap a Non-Null type.
1935
1935
1936
- ### Combining List and Null-Only-On-Error
1936
+ ### Combining List and Semantic-Non-Null
1937
1937
1938
- The List and Null-Only-On-Error wrapping types can compose, representing more
1939
- complex types. The rules for result coercion of Lists and Null-Only-On-Error
1938
+ The List and Semantic-Non-Null wrapping types can compose, representing more
1939
+ complex types. The rules for result coercion of Lists and Semantic-Non-Null
1940
1940
types apply in a recursive fashion.
1941
1941
1942
- For example if the inner item type of a List is Null-Only-On-Error (e.g.
1943
- `[T*]`), then that List may not contain any {null } items unless associated field
1944
- errors were raised . However if the inner type of a Null - Only - On - Error is a List
1945
- (e.g. ` [T]* `), then {null } is not accepted without an accompanying field error
1946
- being raised , however an empty list is accepted .
1942
+ For example if the inner item type of a List is Semantic-Non-Null (e.g. `[!T]`),
1943
+ then that List may not contain any {null } items unless associated field errors
1944
+ were raised . However if the inner type of a Semantic - Non - Null is a List (e.g.
1945
+ `! [T]`), then {null } is not accepted without an accompanying field error being
1946
+ raised , however an empty list is accepted .
1947
1947
1948
1948
Following are examples of result coercion with various types and values :
1949
1949
1950
1950
| Expected Type | Internal Value | Coerced Result |
1951
1951
| ------------- | --------------- | ------------------------------------------- |
1952
- | `[Int ]* ` | `[1, 2, 3]` | `[1, 2, 3]` |
1953
- | `[Int ]* ` | `null ` | `null ` (With logged coercion error) |
1954
- | `[Int ]* ` | `[1, 2, null ]` | `[1, 2, null ]` |
1955
- | `[Int ]* ` | `[1, 2, Error ]` | `[1, 2, null ]` (With logged error) |
1956
- | `[Int !]* ` | `[1, 2, 3]` | `[1, 2, 3]` |
1957
- | `[Int !]* ` | `null ` | `null ` (With logged coercion error) |
1958
- | `[Int !]* ` | `[1, 2, null ]` | `null ` (With logged coercion error) |
1959
- | `[Int !]* ` | `[1, 2, Error ]` | `null ` (With logged error) |
1960
- | `[Int * ]` | `[1, 2, 3]` | `[1, 2, 3]` |
1961
- | `[Int * ]` | `null ` | `null ` |
1962
- | `[Int * ]` | `[1, 2, null ]` | `[1, 2, null ]` (With logged coercion error) |
1963
- | `[Int * ]` | `[1, 2, Error ]` | `[1, 2, null ]` (With logged error) |
1964
- | `[Int * ]!` | `[1, 2, 3]` | `[1, 2, 3]` |
1965
- | `[Int * ]!` | `null ` | Error : Value cannot be null |
1966
- | `[Int * ]!` | `[1, 2, null ]` | `[1, 2, null ]` (With logged coercion error) |
1967
- | `[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 ]` (With logged coercion error) |
1971
- | `[ Int *]* ` | `[1, 2, Error ]` | `[1, 2, null ]` (With logged error) |
1952
+ | `! [Int ]` | `[1, 2, 3]` | `[1, 2, 3]` |
1953
+ | `! [Int ]` | `null ` | `null ` (With logged coercion error) |
1954
+ | `! [Int ]` | `[1, 2, null ]` | `[1, 2, null ]` |
1955
+ | `! [Int ]` | `[1, 2, Error ]` | `[1, 2, null ]` (With logged error) |
1956
+ | `! [Int !]` | `[1, 2, 3]` | `[1, 2, 3]` |
1957
+ | `! [Int !]` | `null ` | `null ` (With logged coercion error) |
1958
+ | `! [Int !]` | `[1, 2, null ]` | `null ` (With logged coercion error) |
1959
+ | `! [Int !]` | `[1, 2, Error ]` | `null ` (With logged error) |
1960
+ | `[! Int ]` | `[1, 2, 3]` | `[1, 2, 3]` |
1961
+ | `[! Int ]` | `null ` | `null ` |
1962
+ | `[! Int ]` | `[1, 2, null ]` | `[1, 2, null ]` (With logged coercion error) |
1963
+ | `[! Int ]` | `[1, 2, Error ]` | `[1, 2, null ]` (With logged error) |
1964
+ | `[! Int ]!` | `[1, 2, 3]` | `[1, 2, 3]` |
1965
+ | `[! Int ]!` | `null ` | Error : Value cannot be null |
1966
+ | `[! Int ]!` | `[1, 2, null ]` | `[1, 2, null ]` (With logged coercion error) |
1967
+ | `[! 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 ]` (With logged coercion error) |
1971
+ | `![! Int ] ` | `[1, 2, Error ]` | `[1, 2, null ]` (With logged error) |
1972
1972
1973
1973
## Directives
1974
1974
0 commit comments