Skip to content

Releases: ghostdogpr/caliban

v0.3.0

23 Nov 06:44
Compare
Choose a tag to compare

Release Notes

Partial failures

Caliban now supports partial failures: instead of returning either an error or a response, it will return a combination of a response and a list of errors. Fields that return an effect that can fail will be defined as nullable and return null on failure, while adding an entry to the list of errors. Infallible effects like UIO are unchanged.

GraphQL#execute now returns a URIO[R, GraphQLResponse[E]] with:

case class GraphQLResponse[+E](data: ResponseValue, errors: List[E])

If you use the Http4sAdapter, there is nothing to change.

wrapExecutionWith

GraphQL#wrapExecutionWith is a new method that takes a function and return a new GraphQL interpreter that'll wrap the execute method with this function. It is used to implement mapError (customize errors) and provide (eliminate the environment), but you can use it for other purposes such as adding a general timeout, logging response times, etc.

The GraphQL type has a new type parameter E so that you can change the error type.

Other Changes

  • Made ArgBuilder#build return an Either instead of an IO.
  • Fixed enum values that were incorrectly suffixed by "Input"
  • Added support for BigInt and BigDecimal (they return a custom scalar)
  • Added fieldName in ExecutionError for better error diagnostics
  • Added an annotation GQLInputName to customize input type names
  • Upgraded ZIO to 1.0.0-RC17

v0.2.1

12 Nov 05:16
Compare
Choose a tag to compare

Release Notes

  • Support arguments for subscriptions. A subscription field can not only be a ZStream but also a function A => ZStream (#69)
  • Improve performance and reliability of Json encoding in Http4s Adapter (#71)
  • Improved performance by pre-generating the execution plan instead of building it for each query.

v0.2.0

31 Oct 02:00
Compare
Choose a tag to compare

Release Notes

Highlights

This release brings support for Query Optimization (deduplication, batching), based on a new data type ZQuery contributed by @adamgfraser.

Imagine the following QraphQL query:

query {
  orders { # calls getOrders
    id
    customer { # calls getCustomer
      id
      name 
    }
  }
}

Without optimizations, this would result in 1 call to getOrders followed by N calls to getCustomer (N being the number of orders). This is commonly referred to as the N+1 Problem. Using ZQuery, you can provide a function that gets a list of customers from a list of IDs, so that Caliban will only perform 2 calls.

See the full documentation for more information.

Other changes

  • Changed the signature of Schema#resolve. It now returns a Step that describes the computation to perform, instead of an IO. This was necessary to enable query optimizations.
  • Added ArgBuilder#mapM by @sh0hei
  • Added missing support for GQLName annotations in ArgBuilder
  • Added a few missing validation rules (see #63)
  • Upgraded ZIO to 1.0.0-RC16

v0.1.1

27 Oct 00:09
Compare
Choose a tag to compare

Release Notes

  • Added an interop module to facilitate usage of caliban with cats-effect compatible effect types by @desbo and @yoohaemin . See documentation for usage.
  • Added a macro function to check graphql queries at compile-time. See documentation for usage.
  • Fixed the nonNull attribute of fields wrapped in ZIO and ZStream.
  • Upgraded ZIO to 1.0.0-RC15

v0.1.0

14 Oct 02:30
Compare
Choose a tag to compare

First official release!

v0.0.6

09 Oct 01:33
Compare
Choose a tag to compare
v0.0.6 Pre-release
Pre-release
Fix release

v0.0.5

01 Oct 11:02
Compare
Choose a tag to compare
v0.0.5 Pre-release
Pre-release
Replace circe-magnolia-derivation by circe-derivation for 2.13 compat