Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency com.github.ghostdogpr:caliban to v2.9.0 #52

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 19, 2022

This PR contains the following updates:

Package Update Change
com.github.ghostdogpr:caliban minor 2.0.1 -> 2.9.0

Release Notes

ghostdogpr/caliban (com.github.ghostdogpr:caliban)

v2.9.0

Compare Source

Release Notes

This release brings a few interesting features, such as support for the @stream directive, alongside a new batch of performance improvements. Note that the @stream addition caused some changes that impact the @defer directive usage as well.

The QuickAdapter now depends on the long-awaited stable 3.0.x version of zio-http, which means no more binary compatibility issues between releases.

Finally, one noticeable change is that we are now using jsoniter internally to encode and decode GraphQL requests and responses, which means you don't need to depend and import one of the tapir-json libraries anymore.

New features

Bug fixes

Performance improvements

Important dependency upgrades

v2.8.1

Compare Source

Release Notes

This small release fixes a couple issues related to the @oneOf introduction in 2.8.0.

Bug fixes

Performance improvements

v2.8.0

Compare Source

Release Notes

This release brings a long-awaited feature: @oneOf inputs, based on this RFC which is almost finalized and already implemented in several libraries in other languages. This allows you to use ADTs as input parameters:

@​GQLOneOfInput
enum Foo {
  case FooString(stringValue: String)
  case FooInt(intValue: Int)
}
case class FooArgs(input: Foo)
case class Queries(foo: FooArgs => String)

This will generate the following schema, and the validation will verify that only one of those fields is provided in incoming queries.

input FooInput @​oneOf {
  stringValue: String
  intValue: Int
}

type Queries {
  foo(input: FooInput!): String!
}

This release also includes a few breaking changes that should impact a very low amount of users, but here they are just in case:

  • Removed code that was deprecated for a long time
  • Removed unnecessary type parameter on Validator.prepare
  • Removed convertHttpStreamingEndpoint/convertHttpEndpointToFuture
  • Migrated the (deprecated) zio-http adapter to use the (recommended) quick adapter, which changes the syntax a bit (you have to pass the interpreter and config directly to the method rather than using the HttpInterpreter / WebSocketInterpreter). If you had RequestInterceptor before, you can use zio-http Middleware instead.
  • Removed the dependency on zio-prelude, so if you relied on Caliban for the transitive dependency, you will have to depend on it explicitly.
  • Some methods (such as GraphQL#interpreter) that returned a ZIO now return an Exit, which is a subtype of ZIO that you can convert to an Either or Option without needing to run the ZIO

New features

Bug fixes

Performance improvements

Code cleanup

v2.7.2

Compare Source

Release Notes

This release contains a few bug fixes and performance improvements.

Bug fixes

Performance improvements

Important dependency upgrades

v2.7.1

Compare Source

Release Notes

This release contains a couple bug fixes and a small addition.

New features

Bug fixes

v2.7.0

Compare Source

Release Notes

This release contains several new features as well as a few performance improvements.

Schema transformations

You can now transform types, fields or arguments of an existing GraphQL object. This gives you an easy alternative to modifying schemas. You can also implement your own custom transformers.

api
  .transform(Transformer.RenameType("InnerObject" -> "Renamed"))
  .transform(Transformer.ExcludeField("Query" -> "myField"))
Scala 3 union type derivation

You can now derive schemas from Scala 3 union types, and they will be translated to GraphQL unions:

type Payload = Foo | Bar
given Schema[Any, Payload] = Schema.unionType[Payload] // in GraphQL => union Payload = Foo | Bar

New features

Performance improvements

Important dependency upgrades

v2.6.0

Compare Source

Release Notes

The highlight of this release is that Websocket support has been added to the QuickAdapter (the adapter that's the fastest to use and also provides the best performance). Since this adapter is using zio-http under the hood, we deprecated the existing tapir-based ZHttpAdapter which you can simply replace by the QuickAdapter. A small breaking change coming with this change is that we moved WebSocketHooks to another package and changed the type to describe transformation from StreamTransformer to ZPipeline.

Apart from that, there are quite a few performance improvements, in particular some coming from zio-query that should make things a lot faster if you use queries with a DataSource.

New features

Bug fixes

Performance improvements

Important dependency upgrades

v2.5.3

Compare Source

Release Notes

This release includes support for subscriptions over Server-Sent Events, as well as a few bug fixes and improvements.

Server
Tools
  • Fixed an issue with schema codegen when using the @lazy directive and the ZIO environment is not Any #​2125 by @​develeon

v2.5.2

Compare Source

Release Notes

This release includes a new set of performance improvements as well as some usability improvements, in particular for schema code generation. It is fully backward compatible with 2.5.0.

Server
Client
Tools

v2.5.1

Compare Source

Release Notes

This release brings a bug fix for an issue that was introduced in 2.5.0 and possibly caused duplicated fields in responses when using fragments. It is fully backward compatible with 2.5.0.

Server
Interop
Tools

v2.5.0

Compare Source

Release Notes

This release brings an incredible amount of performance improvements, some major library upgrades (zio-http, Play) as well as some powerful new derivation abilities such as deriving fields from case class methods.

Server
Adapters
Federation

v2.4.3

Compare Source

Release Notes

This version brings a few bug fixes and improvements related to schema derivation on Scala 3.
In addition to that, it contains a new adapter named QuickAdapter and based on zio-http, that serves 2 purposes:

  • Offer the best performance among all adapters. This adapter is not using Tapir under the hood to prevent any overhead. We picked zio-http and jsoniter-scala because they gave the best benchmarks results among all our supported adapters and json libraries. The only drawback is that it doesn't include WebSocket support at the moment. If you care about performance above all, use this adapter!

  • Be super quick and easy to get started. With this adapter you can simply do that to go from your api to a running server:

import caliban._
import caliban.quick._ // adds syntax to `GraphQL`

val api: GraphQL[Any] = ???

api.runServer(
  port = 8080,
  apiPath = "/api/graphql",
  graphiqlPath = Some("/graphiql")
)
Server
Tools

v2.4.2

Compare Source

Release Notes

This version brings a few bug fixes as well as some performance improvements.
Big thanks to @​kyri-petrou for his many contributions!

Server
Tools
  • Fixed a warning about impure expression that could popup when using the compile time codegen #​1965 by @​satorg

v2.4.1

Compare Source

Release Notes

This version fixes a regression introduced in 2.4.0 that prevents the usage of java.time types in schemas when using Scala 3 and JDK 17+ (https://github.com/ghostdogpr/caliban/pull/1950).

v2.4.0

Compare Source

Release Notes

This version contains:

  • an important number of performance improvements
  • support for new specs and protocols: deprecated input fields, GraphQL over HTTP, new Apollo Caching, Federation 2.5
  • usability improvements, small fixes and library upgrades

[!WARNING]
Due to an issue in zio-http 3.0.0-RC2, servers exposing websocket endpoints via the caliban-zio-http module are required to include additional config for subscriptions to work as shown in this example.

This is a temporary workaround until a new version of zio-http is released which contains a fix to this issue.

Server

Adapters

Tools

Federation

v2.3.1

Compare Source

Release Notes

This version contains important performance improvements as well as support for Pekko.

Server

Adapters

v2.3.0

Compare Source

Release Notes

This version contains a lot of small fixes as well as performance and usability improvements.

Server

Adapters

Tools

  • Added a parameter for codegen when to enable or disable isRepeatable during introspection (disable it if the remote server does not support it) #​1732 by @​ghostdogpr
  • Added support for derives Schema.SemiAuto in schema code generation #​1758 by @​nox213

v2.2.1

Compare Source

Release Notes

This is a tiny release with a single change on ZHttpAdapter (#​1723). We noticed that the type signatures of makeHttpService and makeWebSocketService were inconsistent (the former returned HttpApp[R, Throwable] while the latter returned HttpApp[R, Response] aka App[R]). We've made them both return App[R], which should be easier to use!

v2.2.0

Compare Source

Release Notes

This release brings a few important changes, including a refactor of request interceptors, support for the @defer directive and support for Scala Native in caliban-client 🚀

Love this project? I am now on Github Sponsors. A good way to give back and encourage future developments! ❤️

New Adapter API

Request interceptors and configuration options such as skipValidation or enableIntrospection have been modified to be more powerful: you can now eliminate part of ZIO environment with request interceptors, and you can modify execution configuration dynamically.

These improvements require a small change in existing code. When calling makeHttpService, makeHttpUploadService or makeWebSocketService, you now need to wrap your interpreter into (respectively) an HttpInterpreter, HttpUploadInterpreter or WebSocketInterpreter.

// before
ZHttpAdapter.makeHttpService(interpreter)
// after
ZHttpAdapter.makeHttpService(HttpInterpreter(interpreter))

With these wrapper classes come 2 powerful methods:

  • configure takes a Configurator[R] which is an alias for URIO[R & Scope, Unit].
    It allows configuring the interpreter by running an effect that will run for each request and that can modify the configuration of the running fiber. Built-in configurators such as setSkipValidation, setEnableIntrospection and setQueryExecution are available in the Configurator object and let you dynamically change the configuration of the interpreter.
  • intercept takes an Interceptor[-R1, +R] which is an alias for ZLayer[R1 & ServerRequest, TapirResponse, R].
    It is basically a more powerful version of configure that gives you access to the incoming request (ServerRequest) and lets you modify the environment of the interpreter (from R to R1). A typical use case would be to extract an authentication token from the request and eliminate the authentication requirement from the environment if the token is valid. See an example here. You can also use this to change the configuration based on the incoming request (e.g. allow introspection only when a valid token is present).
val interpreter: GraphQLInterpreter[AuthToken, CalibanError] = ???
// turn our GraphQL interpreter into an HttpInterpreter
val noAuthInterpreter: HttpInterpreter[AuthToken, CalibanError] = HttpInterpreter(interpreter)
// define authentication logic (from a ServerRequest, fail or build an AuthToken)
val auth: ZLayer[ServerRequest, TapirResponse, AuthToken] = ???
// pass our interceptor to eliminate the AuthToken requirement from the environment
val authInterpreter: HttpUploadInterpreter[Any, CalibanError] = httpInterpreter.intercept(auth)
// get our route for Akka Http
val route = AkkaHttpAdapter.makeHttpService(authInterpreter)

This change was done in #​1707 by @​ghostdogpr

Other changes

Server
Client
Adapters

v2.1.0

Compare Source

Release Notes

This release is packed with features, improvements and fixes. In fact, it is probably the single most important release since Caliban Client was added. It contains several breaking changes, so make to read what follows before upgrading!

Schema derivation

One of the most requested features of Caliban was the ability to opt out from the automatic schema derivation and use a semi-automatic approach where you have to create a schema for each individual type. Automatic schema derivation is convenient when you get started, but can quickly becoming a pain when you have large schemas: slow compilation, large amount of generated code, difficulty finding which types require a custom instance or even knowing which instance is actually used.

We decided to make automatic generation optional using an import. Without this import, you will need to provide an implicit/given schema for each type that is not already supported. We also added support for the derives keyword in Scala 3, so that it's super easy to create schemas with the least amount of boilerplate.

Here is how derivation work with Scala 3:

// semi-auto derivation, needs a Schema for inner types
final case class Foo(value: String) derives Schema.SemiAuto

// semi-auto derivation when R in Schema[R, A] is not Any
object CustomSchema extends SchemaDerivation[MyEnv]
final case class Foo(value: String) derives CustomSchema.SemiAuto

// semi-auto derivation without the derives keyword
given Schema[MyEnv, Foo] = Schema.gen

// auto derivation
import Schema.auto._
given Schema[MyEnv, Foo] = genAll

Here's how it looks with Scala 2 (also cross-compile with Scala 3):

// semi-auto derivation, needs Schema for inner types
implicit val fooSchema: Schema[Any, Foo] = Schema.gen

// auto derivation, generates a Schema for inner types
import Schema.auto._
implicit val fooSchema: Schema[Any, Foo] = genAll

// semi-auto derivation when R in Schema[R, A] is not Any
object schema extends GenericSchema[MyEnv]
implicit val fooSchema: Schema[MyEnv, Foo] = schema.gen

// auto derivation when R in Schema[R, A] is not Any
object schema extends GenericSchema[MyEnv]
import schema.auto._
implicit val fooSchema: Schema[MyEnv, Foo] = genAll

Note that ArgBuilder derivation follows the same pattern (without the R part) and requires an import if you want auto generation.

This change was done in #​1591 by @​ghostdogpr

Adapters and Json libraries

Historically each adapter was tied to a specific Json library: for example Circe was used for http4s and zio-http, while play-json was the default for play. As we recently introduced support for jsoniter-scala, we found it was quite inconvenient to use it with the existing adapters. So we decided to make the adapters completely free of any Json dependency, so you can use the Json library you want!

All you have to do is adding one of these Tapir dependencies:

"com.softwaremill.sttp.tapir" %% "tapir-json-circe"     % "1.2.11" // Circe
"com.softwaremill.sttp.tapir" %% "tapir-jsoniter-scala" % "1.2.11" // Jsoniter
"com.softwaremill.sttp.tapir" %% "tapir-json-play"      % "1.2.11" // Play JSON
"com.softwaremill.sttp.tapir" %% "tapir-json-zio"       % "1.2.11" // ZIO JSON

And then later in your code (you only need one!):

import sttp.tapir.json.circe._
import sttp.tapir.json.jsoniter._
import sttp.tapir.json.play._
import sttp.tapir.json.zio._

This change was done in #​1552 by @​kyri-petrou

Performance improvements

Performance was improved in almost every parts of Caliban: from parsing to validation to execution. Even Caliban Client received some love! Here are the details:

  • Used the Fastparse parser on Scala 3, which makes parsing much faster and removes code duplication (previously Fastparse was used for Scala 2 and cats-parse for Scala 3) #​1646 by @​kyri-petrou
  • Used ZPure instead of ZIO for validation logic, which improves validation performance greatly #​1633 by @​paulpdaniels
  • Added multiple execution performance impr

@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from e3c84a4 to 5c97647 Compare January 30, 2023 04:44
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 5c97647 to d852c31 Compare March 28, 2023 14:26
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.0.2 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.1.0 Mar 28, 2023
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from d852c31 to 4177c50 Compare May 28, 2023 11:38
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.1.0 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.2.1 May 28, 2023
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.2.1 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.3.0 Aug 6, 2023
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 4177c50 to 139adad Compare August 6, 2023 12:09
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.3.0 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.3.1 Sep 10, 2023
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 139adad to 615f05e Compare September 10, 2023 04:49
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 615f05e to 1ec51d9 Compare October 15, 2023 17:12
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.3.1 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.0 Oct 15, 2023
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 1ec51d9 to 32b435e Compare October 20, 2023 15:33
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.0 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.1 Oct 20, 2023
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 32b435e to 6775d20 Compare November 9, 2023 06:26
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.1 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.2 Nov 9, 2023
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 6775d20 to e623858 Compare November 16, 2023 01:10
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.2 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.3 Nov 16, 2023
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from e623858 to 5143e92 Compare January 9, 2024 10:29
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.4.3 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.0 Jan 9, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 5143e92 to 884a090 Compare January 16, 2024 14:09
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.0 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.1 Jan 16, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 884a090 to 8de426f Compare February 17, 2024 01:41
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.1 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.2 Feb 17, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 8de426f to 3198da8 Compare March 20, 2024 15:18
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.2 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.3 Mar 20, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 3198da8 to 38748bb Compare April 16, 2024 04:35
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.5.3 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.6.0 Apr 16, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 38748bb to 4da3130 Compare May 29, 2024 13:38
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.6.0 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.7.0 May 29, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 4da3130 to 923bfe7 Compare June 2, 2024 02:13
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.7.0 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.7.1 Jun 2, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 923bfe7 to 593899e Compare June 20, 2024 04:06
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.7.1 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.7.2 Jun 20, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 593899e to 1a38e5c Compare June 28, 2024 06:03
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.7.2 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.8.0 Jun 28, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 1a38e5c to 5a27ea1 Compare July 2, 2024 05:05
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.8.0 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.8.1 Jul 2, 2024
@renovate renovate bot force-pushed the renovate/com.github.ghostdogpr-caliban-2.x branch from 5a27ea1 to ac2a755 Compare September 24, 2024 11:34
@renovate renovate bot changed the title chore(deps): update dependency com.github.ghostdogpr:caliban to v2.8.1 chore(deps): update dependency com.github.ghostdogpr:caliban to v2.9.0 Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants