Releases: ghostdogpr/caliban
v0.3.0
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 anEither
instead of anIO
. - Fixed enum values that were incorrectly suffixed by "Input"
- Added support for
BigInt
andBigDecimal
(they return a custom scalar) - Added
fieldName
inExecutionError
for better error diagnostics - Added an annotation
GQLInputName
to customize input type names - Upgraded ZIO to 1.0.0-RC17
v0.2.1
Release Notes
v0.2.0
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 aStep
that describes the computation to perform, instead of anIO
. This was necessary to enable query optimizations. - Added
ArgBuilder#mapM
by @sh0hei - Added missing support for
GQLName
annotations inArgBuilder
- Added a few missing validation rules (see #63)
- Upgraded ZIO to
1.0.0-RC16
v0.1.1
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 inZIO
andZStream
. - Upgraded ZIO to
1.0.0-RC15
v0.1.0
First official release!
v0.0.6
Fix release
v0.0.5
Replace circe-magnolia-derivation by circe-derivation for 2.13 compat