Skip to content

Releases: ghostdogpr/caliban

v2.5.1

16 Jan 10:42
64096a8
Compare
Choose a tag to compare

Release Notes

This release brings a bug fix for an issue that was introduced in 2.5.0 and possibly caused duplicated fields in responses when using fragments. It is fully backward compatible with 2.5.0.

Server

Interop

Tools

  • Fix server code generation to support @lazy fields with abstract effect #2064 by @johnspade

v2.5.0

26 Dec 09:14
765318f
Compare
Choose a tag to compare

Release Notes

This release brings an incredible amount of performance improvements, some major library upgrades (zio-http, Play) as well as some powerful new derivation abilities such as deriving fields from case class methods.

Server

Adapters

Federation

v2.4.3

16 Nov 00:05
42d739d
Compare
Choose a tag to compare

Release Notes

This version brings a few bug fixes and improvements related to schema derivation on Scala 3.
In addition to that, it contains a new adapter named QuickAdapter and based on zio-http, that serves 2 purposes:

  • Offer the best performance among all adapters. This adapter is not using Tapir under the hood to prevent any overhead. We picked zio-http and jsoniter-scala because they gave the best benchmarks results among all our supported adapters and json libraries. The only drawback is that it doesn't include WebSocket support at the moment. If you care about performance above all, use this adapter!

  • Be super quick and easy to get started. With this adapter you can simply do that to go from your api to a running server:

import caliban._
import caliban.quick._ // adds syntax to `GraphQL`

val api: GraphQL[Any] = ???

api.runServer(
  port = 8080,
  apiPath = "/api/graphql",
  graphiqlPath = Some("/graphiql")
)

Server

Tools

v2.4.2

09 Nov 05:28
f4eb239
Compare
Choose a tag to compare

Release Notes

This version brings a few bug fixes as well as some performance improvements.
Big thanks to @kyri-petrou for his many contributions!

Server

Tools

  • Fixed a warning about impure expression that could popup when using the compile time codegen #1965 by @satorg

v2.4.1

20 Oct 13:20
3c4ab1f
Compare
Choose a tag to compare

Release Notes

This version fixes a regression introduced in 2.4.0 that prevents the usage of java.time types in schemas when using Scala 3 and JDK 17+ (#1950).

v2.4.0

15 Oct 08:01
dce6e9b
Compare
Choose a tag to compare

Release Notes

This version contains:

  • an important number of performance improvements
  • support for new specs and protocols: deprecated input fields, GraphQL over HTTP, new Apollo Caching, Federation 2.5
  • usability improvements, small fixes and library upgrades

Warning

Due to an issue in zio-http 3.0.0-RC2, servers exposing websocket endpoints via the caliban-zio-http module are required to include additional config for subscriptions to work as shown in this example.

This is a temporary workaround until a new version of zio-http is released which contains a fix to this issue.

Server

Adapters

Tools

  • Properly escaped union types in client code generation #1908 by @ghostdogpr
  • Fixed various things in server code generation #1925 by @oyvindberg
  • Added support for a @lazy directive to generate side-effecting fields in server code generation #1927 by @oyvindberg

Federation

v2.3.1

10 Sep 00:39
7a0ff58
Compare
Choose a tag to compare

Release Notes

This version contains important performance improvements as well as support for Pekko.

Server

  • Performance improvements
  • Added support for auto enum derivation with Scala 3 #1834 by @kyri-petrou
  • Added a wrapper that allows skipping selected validation wrappers during introspection #1837 by @kyri-petrou
  • Fixed WS protocol by always returning an id upon errors #1845 by @SvenW
  • Added a helper renderSchema to render a schema without a resolver #1877 by @ghostdogpr

Adapters

v2.3.0

06 Aug 10:47
8c9aa9e
Compare
Choose a tag to compare

Release Notes

This version contains a lot of small fixes as well as performance and usability improvements.

Server

Adapters

Tools

  • Added a parameter for codegen when to enable or disable isRepeatable during introspection (disable it if the remote server does not support it) #1732 by @ghostdogpr
  • Added support for derives Schema.SemiAuto in schema code generation #1758 by @nox213

v2.2.1

13 May 02:04
0c17b43
Compare
Choose a tag to compare

Release Notes

This is a tiny release with a single change on ZHttpAdapter (#1723). We noticed that the type signatures of makeHttpService and makeWebSocketService were inconsistent (the former returned HttpApp[R, Throwable] while the latter returned HttpApp[R, Response] aka App[R]). We've made them both return App[R], which should be easier to use!

v2.2.0

08 May 08:34
a75e3cf
Compare
Choose a tag to compare

Release Notes

This release brings a few important changes, including a refactor of request interceptors, support for the @defer directive and support for Scala Native in caliban-client 🚀

Love this project? I am now on Github Sponsors. A good way to give back and encourage future developments! ❤️

New Adapter API

Request interceptors and configuration options such as skipValidation or enableIntrospection have been modified to be more powerful: you can now eliminate part of ZIO environment with request interceptors, and you can modify execution configuration dynamically.

These improvements require a small change in existing code. When calling makeHttpService, makeHttpUploadService or makeWebSocketService, you now need to wrap your interpreter into (respectively) an HttpInterpreter, HttpUploadInterpreter or WebSocketInterpreter.

// before
ZHttpAdapter.makeHttpService(interpreter)
// after
ZHttpAdapter.makeHttpService(HttpInterpreter(interpreter))

With these wrapper classes come 2 powerful methods:

  • configure takes a Configurator[R] which is an alias for URIO[R & Scope, Unit].
    It allows configuring the interpreter by running an effect that will run for each request and that can modify the configuration of the running fiber. Built-in configurators such as setSkipValidation, setEnableIntrospection and setQueryExecution are available in the Configurator object and let you dynamically change the configuration of the interpreter.
  • intercept takes an Interceptor[-R1, +R] which is an alias for ZLayer[R1 & ServerRequest, TapirResponse, R].
    It is basically a more powerful version of configure that gives you access to the incoming request (ServerRequest) and lets you modify the environment of the interpreter (from R to R1). A typical use case would be to extract an authentication token from the request and eliminate the authentication requirement from the environment if the token is valid. See an example here. You can also use this to change the configuration based on the incoming request (e.g. allow introspection only when a valid token is present).
val interpreter: GraphQLInterpreter[AuthToken, CalibanError] = ???
// turn our GraphQL interpreter into an HttpInterpreter
val noAuthInterpreter: HttpInterpreter[AuthToken, CalibanError] = HttpInterpreter(interpreter)
// define authentication logic (from a ServerRequest, fail or build an AuthToken)
val auth: ZLayer[ServerRequest, TapirResponse, AuthToken] = ???
// pass our interceptor to eliminate the AuthToken requirement from the environment
val authInterpreter: HttpUploadInterpreter[Any, CalibanError] = httpInterpreter.intercept(auth)
// get our route for Akka Http
val route = AkkaHttpAdapter.makeHttpService(authInterpreter)

This change was done in #1707 by @ghostdogpr

Other changes

Server

Client

Adapters