Bot releases are visible (Hide)
Published by ghostdogpr about 4 years ago
zio-query
to 0.2.5
, bringing a x2 speed improvement in the "simple" benchmark scenario #579 thanks to @adamgfraserGQLName
annotation properly to fields #551 by @ghostdogprPublished by ghostdogpr about 4 years ago
@@ printErrors
that prints errors to the console #513 by @ghostdogprExecutionError
inside a resolver #506 by @paulpdanielsCalibanError
with Java conventions #505 by @KrevercontextWrapper
parameter to the Play Adapter that can be used to inject something into ZIO environment using the request context (e.g. auth info, open tracing metadata) #498 by @paulpdanielscontextWrapper
in subscriptions and improved its usability (Play and Akka Http) #519 by @moonkevapplication/graphql
and query
parameter in POST request to Akka HTTP Adapter #514 by @moonkevapplication/graphql
and query
parameter in POST request to Http4s Adapter #521 by @moonkevapplication/graphql
and query
parameter in POST request to Finch Adapter #525 #528 by @keyno63uzhttp
support to reduce maintenance efforts and because its usage is not recommended according to its maintainer. If you want it back, come tell us on Discord.extensions
to GraphQLResponseError
#503 by @cilicioPublished by ghostdogpr over 4 years ago
This release comes with various performance improvements done in #490 by @ghostdogpr and @yoohaemin.
Query parsing, validation, execution: every phase has seen some optimizations! 🎉
Benchmarks show that the introspection query is executed 4x faster than before.
Before:
[info] Benchmark Mode Cnt Score Error Units
[info] GraphQLBenchmarks.introspectCaliban thrpt 5 565.365 ± 27.284 ops/s
[info] GraphQLBenchmarks.introspectSangria thrpt 5 485.646 ± 7.157 ops/s
[info] GraphQLBenchmarks.simpleCaliban thrpt 5 15850.452 ± 554.077 ops/s
[info] GraphQLBenchmarks.simpleSangria thrpt 5 7710.546 ± 140.220 ops/s
After:
[info] Benchmark Mode Cnt Score Error Units
[info] GraphQLBenchmarks.introspectCaliban thrpt 5 2249.019 ± 30.014 ops/s
[info] GraphQLBenchmarks.introspectSangria thrpt 5 495.380 ± 14.566 ops/s
[info] GraphQLBenchmarks.simpleCaliban thrpt 5 20622.959 ± 774.391 ops/s
[info] GraphQLBenchmarks.simpleSangria thrpt 5 7939.774 ± 43.622 ops/s
These improvements cause very minor breaking changes:
toType
, you will need to change it to toType_
which is an optimized version that caches the generated type instead of recalculating it.Field
in a wrapper, fields
and conditionalFields
have been merged into simply fields
, with a new parameter condition: Option[String]
to indicate the field is conditional. In addition to improving performance, this allows maintaining the order of fields between the query and the response.fromSinkAndSourceCoupled
rather than fromSinkAndSource
in the Akka Http Adapter so that streams are properly terminated on WebSocket disconnection by the browser #483 by @moonkevcontextWrapper
parameter to the Akka Http Adapter that can be used to inject something into ZIO environment using the request context (e.g. auth info, open tracing metadata) #494 by @darlPublished by ghostdogpr over 4 years ago
Die
) so that they are properly caught with path and location #463 by @ghostdogprZStream
when it is used outside of a Subscription #457 by @ghostdogpr() => A
#459 by @ghostdogprPublished by ghostdogpr over 4 years ago
caliban-codegen
to caliban-tools
and added a new feature to compare GraphQL schemas from various origins (Caliban, remote server introspection, file, string). See documentation #436 by @ghostdogprSchema
and ArgBuilder
for ZIO Chunk
#439 by @renancaju--effect
option to schema codegen #443 by @AlixBaDataSource
)Published by ghostdogpr over 4 years ago
Schema
for the underlying type #430 by @palangaSelectionBuilder.combineAll
in caliban-client #411 @ghostdogprPublished by ghostdogpr over 4 years ago
query
optional in GET methods of Finch and Akka HTTP adapters #400 by @javimartinezFieldInfo
by @ghostdogprPublished by ghostdogpr over 4 years ago
ZQuery
stack-safe and fixed potential stack overflow exceptions when returning large lists #378 by @adamgfraserPublished by ghostdogpr over 4 years ago
Caliban is now able to generate a GraphQL API from Tapir endpoints! That means that if you use Tapir for exposing a REST API, you should be able to expose a GraphQL API with minimal efforts.
Creating a GraphQL
object is similar to creating routes for http4s or Akka HTTP:
val addBook: Endpoint[Book, Nothing, Unit, Nothing] = ???
def bookAddLogic(book: Book): UIO[Unit] = ???
val api = addBook.toGraphQL(bookAddLogic)
Simple conversions rules will create Query fields for GET endpoints and Mutations fields for POST/PUT/DELETE endpoints. You might need to provide custom Schema
or ArgBuilder
instances if you use types that Caliban can't handle (see schema documentation).
Check the documentation for more information. There's also a full example in the examples project.
Http4sAdapter.makeWebSocketService
's implementation so that incoming messages are processed in a child fiber, allowing usage of FiberRef
#364 by @mitsutaka-takedatoString
is used instead of Json #358 by @gjuhasz86Published by ghostdogpr over 4 years ago
String => ???
or Int => ???
. In that case though, the arbitrary name value
will be used to name the argument. #342 by @ghostdogprZQuery
run arbitrary effects in parallel when using the parallelism combinators #339 by @adamgfraserJson
scalar in Caliban Client #345 by @ghostdogprSubscription
object #340 by @rleibman_
is used as a field by @ghostdogprcaliban-codegen
) separated from the sbt plugin (now named caliban-codegen-sbt
) #327 by @jopricecaliban-client
) #324 by @ghostdogprReadOnlyCaseClass
for improved compile times #324 by @ghostdogprPublished by ghostdogpr over 4 years ago
caliban-federation
#314 by @paulpdanielsZQuery#orDie
#320 by @adamgfraserPublished by ghostdogpr over 4 years ago
ArgBuilder
for Seq
, Set
and Vector
#304 by @javimartinezZQuery
#306 by @adamgfraserArgBuilder
example to the docs #315 by @gjuhasz86Published by ghostdogpr over 4 years ago
There are some minor breaking changes to akka-http adapter API.
With this release AkkaHttpAdapter
doesn't lock you up with circe
, but lets you choose a json backend between circe
and play-json
.
The simplest way to keep previous behavior is to:
AkkaHttpCirceAdapter
trait to your endpoint definition wrapper"de.heikoseeberger" %% "akka-http-circe" % "1.31.0"
dependency to your build.sbt
, because now it's optional for caliban-akka-http
. Luckily, compiler will detect if it's missing.adapter
instead of AkkaHttpAdapter
to create routes.You can see an example of this simple migration here.
A more composable and recommended way to create caliban adapter would be this (this time it's play-json):
val adapter = AkkaHttpAdapter(new PlayJsonBackend)
#292 #296 by @vpavkin
ZQuery
causing some effects to be evaluated twice #291 by @adamgfraserZQuery#optional
#293 by @adamgfraserSchema
instances for Seq
and Vector
#297 by @ghostdogprSchema
instance for Play Json
#294 by @vpavkinPublished by ghostdogpr over 4 years ago
Fixed a bug causing a failure to parse enums used in variables.
Published by ghostdogpr over 4 years ago
Fixed a regression in the WebSocket protocol implementation in Http4sAdapter
and AkkaHttpAdapter
that caused subscriptions not to be received.
Published by ghostdogpr over 4 years ago
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).
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 ).
Option
and List
#254 by @kitlangtonskipValidation
parameter to all adapters #260 by @javimartinezPublished by ghostdogpr over 4 years ago
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!
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 )
Published by ghostdogpr over 4 years ago
caliban-monix
module for Monix interop with support for Task
and Observable
(#214)GraphQL#combine
logic smarter (#217)Published by ghostdogpr over 4 years ago
caliban-codegen
to generate Scala code from a GraphQL Schema by @igorfialko @yoohaemin @ghostdogprMap
, Either
and Tuple
schemas (#197)ZQuery
ergonomics by @adamgfraser (#194 #200)maxDepth
and maxFields
wrappers stack-safePublished by ghostdogpr over 4 years ago
Caliban allows you to perform additional actions at various levels of a query processing, via the concept of Wrapper
. Using wrappers, you can:
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 queriesThe previous feature called query analyzers
have been replaced by wrappers which are strictly more powerful.
Json
scalar for Circe Json (#176). Requires import caliban.interop.circe.json._
.ZStream
used in Queries and Mutations will be transformed into List
since it only makes sense to return a stream for Subscriptions (#174)mapError
makeHttpServiceM
in Akka HTTP Adapter to hide usage of unsafeRun
from calling code (#181) by @loicdescotte