Skip to content

Releases: ghostdogpr/caliban

v2.9.0

24 Sep 07:25
3b51d27
Compare
Choose a tag to compare

Release Notes

This release brings a few interesting features, such as support for the @stream directive, alongside a new batch of performance improvements. Note that the @stream addition caused some changes that impact the @defer directive usage as well.

The QuickAdapter now depends on the long-awaited stable 3.0.x version of zio-http, which means no more binary compatibility issues between releases.

Finally, one noticeable change is that we are now using jsoniter internally to encode and decode GraphQL requests and responses, which means you don't need to depend and import one of the tapir-json libraries anymore.

New features

Bug fixes

  • Fixed ArgBuilder derivation for case classes containing only optional fields by @kyri-petrou in #2408

Performance improvements

Important dependency upgrades

v2.8.1

02 Jul 01:14
ce502f6
Compare
Choose a tag to compare

Release Notes

This small release fixes a couple issues related to the @oneOf introduction in 2.8.0.

Bug fixes

  • Fixed ArgBuilder derivation when input is a value type by @kyri-petrou in #2323
  • Fixed sorting of oneOf inputs and added fallback to parent type annotations for @GQLOneOfInput by @kyri-petrou in #2322

Performance improvements

v2.8.0

28 Jun 05:01
491f043
Compare
Choose a tag to compare

Release Notes

This release brings a long-awaited feature: @oneOf inputs, based on this RFC which is almost finalized and already implemented in several libraries in other languages. This allows you to use ADTs as input parameters:

@GQLOneOfInput
enum Foo {
  case FooString(stringValue: String)
  case FooInt(intValue: Int)
}
case class FooArgs(input: Foo)
case class Queries(foo: FooArgs => String)

This will generate the following schema, and the validation will verify that only one of those fields is provided in incoming queries.

input FooInput @oneOf {
  stringValue: String
  intValue: Int
}

type Queries {
  foo(input: FooInput!): String!
}

This release also includes a few breaking changes that should impact a very low amount of users, but here they are just in case:

  • Removed code that was deprecated for a long time
  • Removed unnecessary type parameter on Validator.prepare
  • Removed convertHttpStreamingEndpoint/convertHttpEndpointToFuture
  • Migrated the (deprecated) zio-http adapter to use the (recommended) quick adapter, which changes the syntax a bit (you have to pass the interpreter and config directly to the method rather than using the HttpInterpreter / WebSocketInterpreter). If you had RequestInterceptor before, you can use zio-http Middleware instead.
  • Removed the dependency on zio-prelude, so if you relied on Caliban for the transitive dependency, you will have to depend on it explicitly.
  • Some methods (such as GraphQL#interpreter) that returned a ZIO now return an Exit, which is a subtype of ZIO that you can convert to an Either or Option without needing to run the ZIO

New features

  • Added support for @oneOf inputs for both server and client by @kyri-petrou in #1846 #2294
  • Made it easier to use tapir with impure effects such as Ox by @ghostdogpr in #2282
  • Added an Scala3-only annotation to derive all case class methods as graphql fields by @kyri-petrou in #2306
  • Added a transformer that excludes fields / inputs based on directives by @kyri-petrou in #2293

Bug fixes

  • Fixed codegen path on Windows by @OlegYch in #2304
  • Fixed derivation of case objects / parameterless case classes that contain @GQLField methods by @kyri-petrou in #2305

Performance improvements

Code cleanup

v2.7.2

20 Jun 01:24
3fb31e1
Compare
Choose a tag to compare

Release Notes

This release contains a few bug fixes and performance improvements.

Bug fixes

Performance improvements

Important dependency upgrades

v2.7.1

02 Jun 01:07
ed6f7e9
Compare
Choose a tag to compare

Release Notes

This release contains a couple bug fixes and a small addition.

New features

Bug fixes

  • Fixed the ExcludeArgument transformer so that it doesn't exclude non-nullable arguments #2257 by @kyri-petrou
  • Fixed missing error path and location when a failure happens in a field wrapper #2259 by @ghostdogpr

v2.7.0

29 May 12:29
b81453b
Compare
Choose a tag to compare

Release Notes

This release contains several new features as well as a few performance improvements.

Schema transformations

You can now transform types, fields or arguments of an existing GraphQL object. This gives you an easy alternative to modifying schemas. You can also implement your own custom transformers.

api
  .transform(Transformer.RenameType("InnerObject" -> "Renamed"))
  .transform(Transformer.ExcludeField("Query" -> "myField"))

Scala 3 union type derivation

You can now derive schemas from Scala 3 union types, and they will be translated to GraphQL unions:

type Payload = Foo | Bar
given Schema[Any, Payload] = Schema.unionType[Payload] // in GraphQL => union Payload = Foo | Bar

New features

Performance improvements

Important dependency upgrades

v2.6.0

16 Apr 00:34
15f7611
Compare
Choose a tag to compare

Release Notes

The highlight of this release is that Websocket support has been added to the QuickAdapter (the adapter that's the fastest to use and also provides the best performance). Since this adapter is using zio-http under the hood, we deprecated the existing tapir-based ZHttpAdapter which you can simply replace by the QuickAdapter. A small breaking change coming with this change is that we moved WebSocketHooks to another package and changed the type to describe transformation from StreamTransformer to ZPipeline.

Apart from that, there are quite a few performance improvements, in particular some coming from zio-query that should make things a lot faster if you use queries with a DataSource.

New features

  • Added WebSocket support to caliban-quick #2150 by @kyri-petrou
  • Added excludeDeprecated option to client code generation #2163 by @jeejeeone
  • Allowed prepending input path to HttpInterpreter-generated Tapir endpoints #2188 by @olisikh
  • Allowed providing a custom zio.query.Cache when executing queries by @kyri-petrou
  • Added interpreterUnsafe method to GraphQL #2160 by @kyri-petrou

Bug fixes

Performance improvements

Important dependency upgrades

v2.5.3

03 Mar 01:02
deaf50c
Compare
Choose a tag to compare

Release Notes

This release includes support for subscriptions over Server-Sent Events, as well as a few bug fixes and improvements.

Server

Tools

  • Fixed an issue with schema codegen when using the @lazy directive and the ZIO environment is not Any #2125 by @develeon

v2.5.2

17 Feb 00:29
a45aaa4
Compare
Choose a tag to compare

Release Notes

This release includes a new set of performance improvements as well as some usability improvements, in particular for schema code generation. It is fully backward compatible with 2.5.0.

Server

Client

Tools

  • Added a new directive called @newtype for the schema codegen to map ID to your own types #2091 by @develeon
  • Made the schema codegen generate the @GQLDeprecated annotation for deprecated fields #2107 by @johnspade
  • Fixed schema codegen when using derives with a ZIO Environment that is not Any #2104 by @develeon
  • Fixed schema comparison of implements #2116 by @ghostdogpr

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