github ghostdogpr/caliban v1.2.0

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

Release Notes

The highlight of this release is the addition of a new sbt plugin to generate your Caliban client code directly from your Caliban server code at compile time. This is useful if you use Caliban on both client and server side. Check the plugin documentation for more details.

Here's a little preview showing how you tell sbt where your GraphQL server API is defined:

lazy val api =
  project
    .enablePlugins(CompileTimeCalibanServerPlugin)
    .settings(
      Compile / ctCalibanServer / ctCalibanServerSettings :=
        Seq(
          "com.example.my.awesome.project.api.CalibanServer.graphqlApi" -> ClientGenerationSettings.default
        )
    )

It is still very new, so let us know if you encounter any bug. This sbt voodoo magic was brought in #1037 by @guizmaii 🙏

Server

  • Added support for @GQLDefault annotation for defining the default value of a field #1043 by @frekw
  • Added Schema and ArgBuilder instances for Short #1011 by @Fluxx
  • Added helpers for creating Schema instances for non-Throwable errors, see customErrorEffectSchema, customErrorQuerySchema and customErrorStreamSchema #1059 by @ghostdogpr
  • Fixed fragment spreads parsing in Scala 3 #1066 by @ghostdogpr
  • Fixed field metadata for enums coming from JSON variables (they now return EnumValue instead of StringValue) #1064 by @frekw

Adapters

  • Upgraded http4s to 0.23.5. This caused a change in the interface of makeWebSocketService, because WebSocketBuilder was deprecated by http4s. It now requires a WebSocketBuilder2. See the examples project for an updated usage. #1075 by @ghostdogpr
  • Added WebSocket lifecycle hooks to the zio-http adapter #1013 by @frekw

Tools

  • Added a new sbt plugin to generate client code from server code #1037 by @guizmaii (see above)
  • Fixed deprecated behaviour in SchemaLoader.fromCaliban #1006 by @ghostdogpr
  • Fixed LocationInfo json decoding #1015 by @frekw
  • Fixed interface types resolution in RemoteSchema #1018 by @frekw
  • Added GraphQL error extensions decoding #1038 by @frekw
  • Added then to the list of reserved keywords #1032 by @RhnSharma
  • Added SchemaLoader.fromDocument #1036 by @frekw

Don't miss a new caliban release

NewReleases is sending notifications on new releases.