Question mark sn#3
Conversation
| @@ -1257,6 +1298,17 @@ Type : Name | |||
| - {type} must not be {null} | |||
| - Return {type} | |||
There was a problem hiding this comment.
I think you want to delete this semantic block
| Type : Type ? | ||
|
|
||
| - Let {nullableType} be the result of evaluating {Type} | ||
| - Return {nullableType} |
There was a problem hiding this comment.
This is really confusing; I think delete the Type : Type block above, and instead have:
| Type : Type ? | |
| - Let {nullableType} be the result of evaluating {Type} | |
| - Return {nullableType} | |
| Type : Name ? | |
| - Let {name} be the string value of {Name} | |
| - Let {type} be the type defined in the Schema named {name} | |
| - {type} must not be {null} | |
| - Return {type} | |
| Type : ListType ? | |
| - Let {itemType} be the result of evaluating {ListType} | |
| - Let {type} be a List type where {itemType} is the contained type. | |
| - Return {type} |
| exception that {null} will result in a field error being raised. Semantic-Non-Null | ||
| types are only valid in a document that also contains a `@SemanticNullability` | ||
| document-level directive. In such a document, Semantic-Non-Null fields have no | ||
| adornment, much like nullable fields in documents without that directive. |
There was a problem hiding this comment.
The type system should be valid without reference to documents; support for SDL is optional.
| In docuements with a `@SemanticNullability` directive, input types are unaltered in | ||
| terms of syntax. Unadorned types still represent nullable input types. |
There was a problem hiding this comment.
| In docuements with a `@SemanticNullability` directive, input types are unaltered in | |
| terms of syntax. Unadorned types still represent nullable input types. | |
| In documents with a `@SemanticNullability` directive, input types are unaltered in | |
| terms of syntax. Unadorned types still represent nullable input types. |
There was a problem hiding this comment.
Wait so unadorned is nullable on input but non-null on output? What about if we add something like struct in future that allows the same composite type to be represented on both input and output - you're saying that the input field is allowed to be null, but when it's presented through output it would cause a non-null error to be raised?
@semanticNullability
struct Struct {
nullable: Int?
semanticNonNull: Int
strictNonNull: Int!
}
type Query {
identity(struct: Struct): Struct
}
query {
# Valid input since unadorned is nullable on input?
identity(struct: { nullable: null, semanticNonNull: null, strictNonNull: 0 }) {
nullable
# Identity produces error here?
semanticNonNull
strictNonNull
}
}| - `ENUM_VALUE` | ||
| - `INPUT_OBJECT` | ||
| - `INPUT_FIELD_DEFINITION` | ||
| - `DOCUMENT` |
There was a problem hiding this comment.
Should we extract document level directives to a separate spec PR, it seems to be lumped in here but sounds like a meaningful addition in the grander scheme either way
There was a problem hiding this comment.
Yeah truthfully we could also do no null propagation mode as it's own PR as well.
There was a problem hiding this comment.
These should indeed be separate PRs 👍
a77383a to
90c668c
Compare
!!! IMPORTANT !!!
Please Read https://github.com/facebook/graphql/blob/master/CONTRIBUTING.md before creating a Pull Request.