Releases: ghostdogpr/caliban
v0.7.2
Release Notes
Fixed a bug causing a failure to parse enums used in variables.
v0.7.1
Release Notes
Fixed a regression in the WebSocket protocol implementation in Http4sAdapter
and AkkaHttpAdapter
that caused subscriptions not to be received.
v0.7.0
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
- Fixed an error when receiving a response with no data field #252 by @ghostdogpr
- Fixed input values encoding #253 by @ghostdogpr
- Added a default value for arguments of type
Option
andList
#254 by @kitlangton
Other Changes
- Fixed handling of variables nested inside lists and objects #257 by @Krever
- Improved schema validation #243 #244 by @TobiasPfeifer @mriceron
- Added
skipValidation
parameter to all adapters #260 by @javimartinez - Added support for error extensions #246 by @DJLemkes
- Upgraded Finch to 0.32.1 and added support for Scala 2.13 #278 by @ghostdogpr
- Allowed defining an empty root query (useful when you break your API in multiple parts and combine them) #274 by @ghostdogpr
- Added parser support for Type System Extensions #266 by @jorge-vasquez-2301
v0.6.0
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
v0.5.1
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
andTuple
schemas (#197) - Improvements to
ZQuery
ergonomics by @adamgfraser (#194 #200) - Made
maxDepth
andmaxFields
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
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 valuemaxFields
returns a wrapper that fails queries whose number of fields is higher than a given valuetimeout
returns a wrapper that fails queries taking more than a specified timeprintSlowQueries
returns a wrapper that prints slow queriesonSlowQueries
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). Requiresimport 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 intoList
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 ofunsafeRun
from calling code (#181) by @loicdescotte - Updated akka to 2.6.3
- Updated fastparse to 2.2.3
v0.4.2
Release Notes
- Improvements to
ZQuery
, including a simplification ofDataSource
that no longer requires aService
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
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)
v0.3.1
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