v0.5.0
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 valuemaxFields
returns a wrapper that fails queries whose number of fields is higher than a given valuetimeout
returns a wrapper that fails queries taking more than a specified timeprintSlowQueries
returns a wrapper that prints slow queriesonSlowQueries
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). Requiresimport 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 intoList
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 ofunsafeRun
from calling code (#181) by @loicdescotte - Updated akka to 2.6.3
- Updated fastparse to 2.2.3