@@ -109,11 +109,35 @@ to handle errors in the relevant places.
109
109
110
110
However, this would mean that clients such as Relay would want to add ` ? ` in
111
111
every position, causing an "explosion" of question marks, because really what
112
- Relay desired was to disable null propagation entirely.
112
+ Relay desired was to disable error propagation entirely.
113
113
114
- ## Semantic nullability
114
+ ## Disabling error propagation
115
115
116
- What we ultimately realised is that GraphQL is missing a type.
116
+ It became clear that disabling error propagation was desired by advanced GraphQL
117
+ clients and vital for ensuring that normalized caches were as useful as possible
118
+ and that we could live up to the promise of GraphQL's partial success without
119
+ compromise. But that was only part of the problem - the other part was that we
120
+ want to see the "true" nullability of fields, the nullability if we were to
121
+ exclude errors.
122
+
123
+ Note: this RFC assumes that clients may opt out of error propagation via some
124
+ mechanism that is outside the scope of this RFC and will be handled in a
125
+ separate RFC (e.g. via a directive such as ` @noErrorPropagation ` or
126
+ ` @behavior(onError: null) ` ; or via a request-level flag) - in general the
127
+ specific mechanism is unimportant and thus solutions are not expected to comment
128
+ on it unless the choice is significant to the proposal.
129
+
130
+ ### Semantic nullability
131
+
132
+ We realised that if we were to do this, we would need two schemas: one for when
133
+ null bubbling is disabled, where the true nullability of fields could be
134
+ represented; and one for the traditional error handling behavior, where
135
+ nullability would need to factor in that errors can occur.
136
+
137
+ However, maintaining two nearly-identical-except-for-nullability schemas is a
138
+ chore... and it felt like it was solveable if we could teach GraphQL to
139
+ understand this need... What we ultimately realised is that GraphQL is missing a
140
+ type.
117
141
118
142
Ignoring errors, if we look at our business logic we can determine if a field is
119
143
either _ semantically nullable_ (it's meaningful for this field to be null - for
@@ -143,8 +167,7 @@ non-null" type.
143
167
# 📜 Problem Statement
144
168
145
169
GraphQL needs to be able to represent semantically nullable and semantically
146
- non-nullable types as such whilst allowing errors to occur in either position,
147
- without triggering error propagation.
170
+ non-nullable types as such when error propagation is disabled.
148
171
149
172
# 📋 Solution Criteria
150
173
0 commit comments