Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Result
is now a first class type which can represent aSuccess
(a result of typeT
), aWarning
(a result and also client-reportable GraphQL errors), aFailure
(client-reportable GraphQL errors only) and anInternalError
(an error which should not be reported to clients).Result
has instances forMonadError
,Traverse
,Eq
andSemigroup
and is accompanied by aResultT
transformer.This is a breaking change, but its main manifestation in user code is that elaborators and effects need to use
Result
's.success
syntax instead ofIor
's.rightIor
syntax.Mapping
's effect now requires aMonadThrow
instance rather than aMonad
. This is to allow internal errors in a finalResult
to be unpacked into the effect. This allows us to return anF[Json]
or aStream[F, Json]
rather than anF[Result[Json]]
orStream[F, Result[Json]]
which improves the user ergonomics somewhat.Unfortunately the use of
Streams
means that for the pure tests in core we can't replaceId
withEither[Throwable, *]
because there is no instance offs2.Compiler
for that type. Rather than jump through hoops to support pure operation, which is only likely to be useful in tests, the formerly pure tests have simply been switched over toIO
.Several cases where illegal states were silently ignored are now correctly reported as internal errors.
All failure cases have been checked to ensure that internal errors will not be leaked to clients.
All occurrences of
sys.error
have been eliminated.All assertions now represent logic errors in Grackle. Whilst it's possible that these might be triggered by (for example) user errors in mappings, the implication is that these should have been caught and reported prior to hitting an assertion.
Fixes #199 and #200.