Skip to content

Releases: ghostdogpr/caliban

v0.7.2

20 Mar 08:44
Compare
Choose a tag to compare

Release Notes

Fixed a bug causing a failure to parse enums used in variables.

v0.7.1

16 Mar 08:28
Compare
Choose a tag to compare

Release Notes

Fixed a regression in the WebSocket protocol implementation in Http4sAdapter and AkkaHttpAdapter that caused subscriptions not to be received.

v0.7.0

12 Mar 14:12
7b17d21
Compare
Choose a tag to compare

Release Notes

ZIO upgrade

Caliban is now using ZIO 1.0.0-RC18-2 which should be one of the last versions before it reaches 1.0.0. All the examples have been updated to make use of the new ZLayer data type for building and providing environments (#279 by @ghostdogpr ).

In addition to this, ZQuery and GraphQLInterpreter now have provideLayer variants (#270 #271 by @adamgfraser @ghostdogpr).

Type name validation

When turning your API into an interpreter, Caliban will now verify that each type is defined only once and return an error if for example it finds a clash between 2 case classes with the same name from different packages. In the process, the check method was moved from GraphQL to GraphQLInterpreter (#274 by @ghostdogpr ).

Caliban Client bug fixes and improvements

Other Changes

v0.6.0

26 Feb 01:06
Compare
Choose a tag to compare

Release Notes

GraphQL Client

This release comes with the first version of a new module called caliban-client that allows writing and executing type-safe GraphQL queries in plain Scala. Check the docs for more information!

Breaking change

The method GraphQL#interpreter now returns an effect that can fail with a ValidationError. This change allows performing additional checks when turning an API into an interpreter, such as verifying that types are not using forbidden names, etc. You'll need to modify your code to run this effect before you can use the interpreter. (#227 #233 by @ghostdogpr @palanga )

Other Changes

  • Added new adapter for Finch (#179) by @hderms
  • Added support for interfaces using an annotation (#223)
  • Added custom directive support (#225) by @paulpdaniels
  • Added wrapper for Apollo Caching (#225) by @paulpdaniels
  • Fixed an issue causing a validation error for input scalars that are object-shaped (#241)
  • Updated magnolia to 0.12.7

v0.5.2

17 Feb 14:11
712f74c
Compare
Choose a tag to compare

Release Notes

  • New caliban-monix module for Monix interop with support for Task and Observable (#214)
  • Added support for WebSockets in Akka HTTP Adapter (#219) together with @phderome
  • Made GraphQL#combine logic smarter (#217)
  • Updated http4s to 0.21.1

v0.5.1

10 Feb 07:20
Compare
Choose a tag to compare

Release Notes

  • Added an sbt plugin called caliban-codegen to generate Scala code from a GraphQL Schema by @igorfialko @yoohaemin @ghostdogpr
  • Solved a potential stack overflow issue with Map, Either and Tuple schemas (#197)
  • Improvements to ZQuery ergonomics by @adamgfraser (#194 #200)
  • Made maxDepth and maxFields wrappers stack-safe
  • Updated fastparse to 2.2.4
  • Updated http4s to 0.21.0
  • Updated cats-effect to 2.1.1
  • Updated circe to 0.13.0

v0.5.0

29 Jan 07:35
Compare
Choose a tag to compare

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 value
  • maxFields returns a wrapper that fails queries whose number of fields is higher than a given value
  • timeout returns a wrapper that fails queries taking more than a specified time
  • printSlowQueries returns a wrapper that prints slow queries
  • onSlowQueries 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). Requires import 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 into List 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 of unsafeRun from calling code (#181) by @loicdescotte
  • Updated akka to 2.6.3
  • Updated fastparse to 2.2.3

v0.4.2

11 Jan 03:25
Compare
Choose a tag to compare

Release Notes

  • Improvements to ZQuery, including a simplification of DataSource that no longer requires a Service by @adamgfraser. See #160 for details.
  • Fixed the encoding of error messages by @paulpdaniels (#145)
  • Documentation improvements by @phderome
  • Updated akka-stream to 2.6.1
  • Updated fastparse to 2.2.2
  • Updated magnolia to 0.12.6

v0.4.1

20 Dec 01:37
Compare
Choose a tag to compare

Release Notes

Structural changes

  • GraphQL[R, Q, M, S, E] is simplified into GraphQL[R].
  • GraphQLInterpreter[R, E] is a wrapper around GraphQL that allows changing the R, the E and running any wrapper around the execution. It's obtained by just calling .interpreter on the GraphQL object. The execute method is available on this object.
  • It is now possible to combine GraphQL objects with |+|. This allows splitting a large API into smaller chunks and work around Scala limitation of 22 fields.

Example:

val api1 = graphQL(...)
val api2 = graphQL(...)
val api = api1 |+| api2

Query Analyzers

A query analyzer is a piece of code that is executed on a query before its execution. It allows you to analyze the queries and possibly rejecting it, transforming it or running an effect.
This release comes with 2 builtin analyzers for limiting query depth and number of fields:

val api = 
  maxDepth(2)(
    maxFields(5)(
      graphQL(...)
    )
  )

You can use your own by implementing a function with the following signature (with Field being the root query field):

Field => ZIO[R, CalibanError, Field]

Other Changes

  • Support for Akka HTTP (#72) by @jona7o
  • Renamed makeRestService to makeHttpService . The old name is still there but deprecated. (#125)
  • Changed builtin schema for java UUID so that it returns ID scalar instead of String (#126) by @mriceron
  • Added builtin schema for Scala Future (#124)
  • Fixed a bug when the same field was queries multiple times using aliases (#115)

v0.3.1

05 Dec 00:55
c60af3b
Compare
Choose a tag to compare

Release Notes

  • Added support for UUID (#104)
  • Fixed an issue causing nested input types to be missing during introspection (#101)
  • Moved circe encoders/decoders to the core module with circe as an optional dependency (#102) by @rtimush
  • Added a helper method to make it easier to "inject" something into the ZIO environment when using http4s (#100) by @fokot
  • Added graphiql to the example project (#106) by @fokot
  • Added custom scalars in GraphQL#render (#108)
  • Added a custom error message when a Schema can not be found at compile-time, with a few pointers on how to solve it.
  • Updated magnolia to 0.12.2. This update is recommended as it solves some weird compilation errors.
  • Updated zio-interop-cats to 2.0.0.0-RC10
  • Update http4s to 0.21.0-M6