github ghostdogpr/caliban v0.7.7

latest releases: v2.6.0, v2.5.3, v2.5.2...
4 years ago

Release Notes

Tapir Integration

Caliban is now able to generate a GraphQL API from Tapir endpoints! That means that if you use Tapir for exposing a REST API, you should be able to expose a GraphQL API with minimal efforts.

Creating a GraphQL object is similar to creating routes for http4s or Akka HTTP:

val addBook: Endpoint[Book, Nothing, Unit, Nothing] = ???
def bookAddLogic(book: Book): UIO[Unit] = ???

val api = addBook.toGraphQL(bookAddLogic)

Simple conversions rules will create Query fields for GET endpoints and Mutations fields for POST/PUT/DELETE endpoints. You might need to provide custom Schema or ArgBuilder instances if you use types that Caliban can't handle (see schema documentation).

Check the documentation for more information. There's also a full example in the examples project.

Other Changes

  • Changed Http4sAdapter.makeWebSocketService's implementation so that incoming messages are processed in a child fiber, allowing usage of FiberRef #364 by @mitsutaka-takeda
  • Added options to the codegen tool to pass a custom scalafmt file or use custom headers when getting the schema by introspection #357 by @kiranbayram
  • Fixed newline handling in graphql response when toString is used instead of Json #358 by @gjuhasz86
  • Handled Scala reserved keywords properly in schema code generation

Build

  • Upgraded Magnolia to 0.16.0
  • Upgraded Monix to 3.2.1
  • Upgrade http4s to 0.21.4

Don't miss a new caliban release

NewReleases is sending notifications on new releases.