Skip to content

Commit 9906241

Browse files
committed
errors and validation formal definitions
1 parent 838678c commit 9906241

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

spec/Section 5 -- Validation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ SameResponseShape(fieldA, fieldB):
429429

430430
* Let {typeA} be the return type of {fieldA}.
431431
* Let {typeB} be the return type of {fieldB}.
432+
* Let {fieldARequiredStatus} be the required status of {fieldA}
433+
* Let {fieldBRequiredStatus} be the required status of {fieldB}
434+
* Let {typeA} be the result of {ModifiedOutputType(typeA, fieldARequiredStatus)}
435+
* Let {typeB} be the result of {ModifiedOutputType(typeB, fieldBRequiredStatus)}
432436
* If {typeA} or {typeB} is Non-Null.
433437
* If {typeA} or {typeB} is nullable, return false.
434438
* Let {typeA} be the nullable type of {typeA}

spec/Section 6 -- Execution.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ and a final type is produced.
567567

568568
ModifiedOutputType(outputType, requiredStatus):
569569
* If {requiredStatus} is 'required' and {outputType} is not a Non-Nullable type:
570-
* Return Non-Null with an inner type of {outputType}.
570+
* Return `Non-Null` with an inner type of {outputType}.
571571
* Otherwise if {requiredStatus} is 'optional':
572572
* If {outputType} is not a Non-Nullable type:
573573
* Return {outputType}.
@@ -772,9 +772,9 @@ field returned {null}, and the error must be added to the {"errors"} list in
772772
the response.
773773

774774
If the result of resolving a field is {null} (either because the function to
775-
resolve the field returned {null} or because a field error was raised), and that
776-
field is of a `Non-Null` type, then a field error is raised. The
777-
error must be added to the {"errors"} list in the response.
775+
resolve the field returned {null} or because a field error was raised), and
776+
the {ModifiedOutputType} of that field is of a `Non-Null` type, then a field
777+
error is raised. The error must be added to the {"errors"} list in the response.
778778

779779
If the field returns {null} because of a field error which has already been
780780
added to the {"errors"} list in the response, the {"errors"} list must not be
@@ -783,8 +783,8 @@ field.
783783

784784
Since `Non-Null` type fields cannot be {null}, field errors are propagated to be
785785
handled by the parent field. If the parent field may be {null} then it resolves
786-
to {null}, otherwise if it is a `Non-Null` type, the field error is further
787-
propagated to its parent field.
786+
to {null}, otherwise if its {ModifiedOutputType} is a `Non-Null` type, the field
787+
error is further propagated to its parent field.
788788

789789
If a `List` type wraps a `Non-Null` type, and one of the elements of that list
790790
resolves to {null}, then the entire list must resolve to {null}.

0 commit comments

Comments
 (0)