github ghostdogpr/caliban v0.3.0

latest releases: v2.9.0, v2.8.1, v2.8.0...
4 years ago

Release Notes

Partial failures

Caliban now supports partial failures: instead of returning either an error or a response, it will return a combination of a response and a list of errors. Fields that return an effect that can fail will be defined as nullable and return null on failure, while adding an entry to the list of errors. Infallible effects like UIO are unchanged.

GraphQL#execute now returns a URIO[R, GraphQLResponse[E]] with:

case class GraphQLResponse[+E](data: ResponseValue, errors: List[E])

If you use the Http4sAdapter, there is nothing to change.

wrapExecutionWith

GraphQL#wrapExecutionWith is a new method that takes a function and return a new GraphQL interpreter that'll wrap the execute method with this function. It is used to implement mapError (customize errors) and provide (eliminate the environment), but you can use it for other purposes such as adding a general timeout, logging response times, etc.

The GraphQL type has a new type parameter E so that you can change the error type.

Other Changes

  • Made ArgBuilder#build return an Either instead of an IO.
  • Fixed enum values that were incorrectly suffixed by "Input"
  • Added support for BigInt and BigDecimal (they return a custom scalar)
  • Added fieldName in ExecutionError for better error diagnostics
  • Added an annotation GQLInputName to customize input type names
  • Upgraded ZIO to 1.0.0-RC17

Don't miss a new caliban release

NewReleases is sending notifications on new releases.