This represents the last major step in consolidating how field errors are modeled on Snapshot. Here we move missing required fields into the existing errorResponseFields (which should probably get renamed at some point) and are now directly stored in their event shape, rather than needing an intermediate shape.
This comes with a few small changes:
The decision of if we should throw or not is now guided by the actual event rather than just the presence of @throwOnFieldError on the fragment being read. This is important because we may inherit events from resolvers that we read.
We now throw individual errors based on the first field error we encounter rather than throwing a composite error with lots of metadata attached. In practice I think this is probably better. Many errors are likely uncommon, and having an informative error message is likely to result in a more actionable error report (error reporting infra won't easily pick up the metadata). Advanced users are free to use the FieldLogger to build more advanced errors if they wish
We dropped the feature where cascading missing required field errors were not logged. We now log all required field errors (even if some are the result of previous errors) but only the first error will throw.
This represents the last major step in consolidating how field errors are modeled on Snapshot. Here we move missing required fields into the existing
errorResponseFields
(which should probably get renamed at some point) and are now directly stored in their event shape, rather than needing an intermediate shape.This comes with a few small changes:
@throwOnFieldError
on the fragment being read. This is important because we may inherit events from resolvers that we read.