Skip to content

Commit ab61cd7

Browse files
committed
Overhaul overview
1 parent 3c8a3c1 commit ab61cd7

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

spec/Appendix C -- Transitional Non-Null.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,23 @@ gradual migration toward semantic nullability while preserving compatibility.
88

99
## Overview
1010

11-
12-
The introduction of _error behavior_ to this specification allows clients to
13-
take responsibility for error handling, no longer having the schema perform
14-
error propagation and destroying potentially useful response data in the
15-
process. With this move towards clients handling errors, designers of new
16-
schemas (or new fields in existing schemas) no longer need to factor whether or
17-
not a field is likely to error into its nullability; designers can mark a
18-
_semantically_ non-nullable _response position_ (a place where {null} is not a
19-
semantically valid value for the data) as `Non-Null`, writing a {null} there on
20-
error in the knowledge that the client now takes responsibility for handling
21-
errors and preventing these placeholder {null} values from being read.
22-
23-
However, for schema designers that need to support legacy clients that do not
24-
exhibit these error handling properties, marking semantically non-nullable
25-
response positions as `Non-Null` would mean that more of the response would be
26-
destroyed for these clients on error, potentially turning local widget errors
27-
into full screen errors.
28-
29-
To allow you to add `Non-Null` to existing fields during this transitional time,
30-
whilst the fields are still in use by legacy clients, without changing their
31-
error propagation boundaries, this appendix introduces the optional
32-
`@noPropagate` directive.
11+
With the introduction of _error behavior_, clients can take responsibility for
12+
handling of _execution error_: correlating {"errors"} in the result with `null`
13+
values inside {"data"} and thereby removing the ambiguity that error propagation
14+
originally set out to solve. If all clients adopt this approach then schema
15+
designers can, and should, reflect true nullability in the schema, marking
16+
fields as `Non-Null` based on their data semantics without regard to whether or
17+
not they might error.
18+
19+
However, legacy clients may not perform this correlation. Introducing `Non-Null`
20+
in such cases could cause errors to propagate further, potentially turning a
21+
previously handled error in a single field into a full-screen error in the
22+
application.
23+
24+
To support a smooth transition, this appendix introduces the `@noPropagate`
25+
directive and the concept of _transitional_ Non-Null types. These wrappers raise
26+
errors like regular `Non-Null` types, but suppress propagation and appear
27+
nullable in introspection when using the legacy {"PROPAGATE"} _error behavior_.
3328

3429
## The @noPropagate Directive
3530

0 commit comments

Comments
 (0)