Commit 8db8527
committed
Testing making TableData fault tolerant
If the data for a single run could not be found, it should not prevent
the data for other runs being returned.
The way async-graphql handles this is... odd. By making the resolver
return an Option<Result<T,E>> but only ever actually returning a Some(_)
variant, errors are added to the errors list in the response and the
rest of the query is executed as expected.
Adding the extra Option layer breaks error handling via the ? operator
which would make the resolver noisy so the inner logic is moved into a
non-object impl block which can then be called and wrapped by the
graphql macro wrapped version of the same method.1 parent 560b026 commit 8db8527
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
138 | 148 | | |
139 | 149 | | |
140 | 150 | | |
| |||
0 commit comments