Skip to content

v0.5.0

Compare
Choose a tag to compare
@ghostdogpr ghostdogpr released this 29 Jan 07:35

Release Notes

Major changes

Caliban allows you to perform additional actions at various levels of a query processing, via the concept of Wrapper. Using wrappers, you can:

  • verify that a query doesn't reach some limit (e.g. depth, complexity)
  • modify a query before it's executed
  • add timeouts to queries or fields
  • log each field execution time
  • support Apollo Tracing or anything similar
  • etc.

Use GraphQL#withWrapper or @@ to attach a wrapper to an API:

val api = graphQL(...) @@ timeout(3 seconds)

Built-in wrappers include:

  • maxDepth returns a wrapper that fails queries whose depth is higher than a given value
  • maxFields returns a wrapper that fails queries whose number of fields is higher than a given value
  • timeout returns a wrapper that fails queries taking more than a specified time
  • printSlowQueries returns a wrapper that prints slow queries
  • onSlowQueries returns a wrapper that can run a given function on slow queries

The previous feature called query analyzers have been replaced by wrappers which are strictly more powerful.

Other Changes

  • Added support for Apollo Tracing (#165)
  • Added path information in errors (#165)
  • Added source location information in errors (#168) by @paulpdaniels
  • Support for custom Json scalar for Circe Json (#176). Requires import caliban.interop.circe.json._.
  • Support for GET requests in http4s and akka adapters (#177) by @phderome
  • ZStream used in Queries and Mutations will be transformed into List since it only makes sense to return a stream for Subscriptions (#174)
  • Fixed a potential class cast exception when using mapError
  • Added variant makeHttpServiceM in Akka HTTP Adapter to hide usage of unsafeRun from calling code (#181) by @loicdescotte
  • Updated akka to 2.6.3
  • Updated fastparse to 2.2.3