github ghostdogpr/caliban v0.4.1

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

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)

Don't miss a new caliban release

NewReleases is sending notifications on new releases.