Release Notes
Structural changes
GraphQL[R, Q, M, S, E]
is simplified intoGraphQL[R]
.GraphQLInterpreter[R, E]
is a wrapper aroundGraphQL
that allows changing theR
, theE
and running any wrapper around the execution. It's obtained by just calling.interpreter
on theGraphQL
object. Theexecute
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
tomakeHttpService
. The old name is still there but deprecated. (#125) - Changed builtin schema for java
UUID
so that it returnsID
scalar instead ofString
(#126) by @mriceron - Added builtin schema for Scala
Future
(#124) - Fixed a bug when the same field was queries multiple times using aliases (#115)