Predefined error types, extensions & more for com.github.michaelbull.result.Result
.
typealias AppResult<V> = Result<V, AppError>
open class BadRequestError : AppError
open class InternalAppError : AppError
Adds support for result data fetchers.
@DgsQuery
fun bar(): Bar {
return Bar(listOf("Bar"))
}
@DgsData(
parentType = DgsConstants.BAR.TYPE_NAME,
field = DgsConstants.BAR.Waldos
)
fun barWaldos(): AppResult<List<Waldo>> {
return Err(BadRequestError("Bar"))
}
Redefines certain graphql invocations at runtime via ByteBuddy & provides custom exception handler in order to work.
⚠️ When Spring is started, an attempt is made to install a ByteBuddy agent. If this fails and is not supported by the JVM platform used, one can use the older error handling model.One needs to provide a configuration based on the
ResultFetcherAspectConfiguration
class. This will create an aspect that handlesDataFetcherResults
like typicalResults
. Please note that the data fetcher must also returnDataFetcherResult
. One can convert aResult
into one using thegetDataFetcher()
extension method. Directly returing aResult
type is not supported in this model.
⚠️ Usage with data loader is currently evaluated and not supported. Please transformResults
manually toTry
if needed.
Provides @TransactionalResult
annotation & corresponding aspect that provides JPA transactions support for methods that return a Result
.
Based on the timeless @Transactional
annotation from Spring.