zio / zio-quickstarts

A minimal quickstart ZIO application for writing a RESTful Web Service
https://zio.dev/guides/#quickstart-guides
60 stars 39 forks source link

Update dependency com.github.ghostdogpr:caliban to v2.4.3 #24

Closed renovate[bot] closed 2 months ago

renovate[bot] commented 1 year ago

Mend Renovate logo banner

This PR contains the following updates:

Package Update Change
com.github.ghostdogpr:caliban minor 2.0.0 -> 2.4.3

Release Notes

ghostdogpr/caliban (com.github.ghostdogpr:caliban) ### [`v2.4.3`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.4.3) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.4.2...v2.4.3) ### 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: ```scala import caliban._ import caliban.quick._ // adds syntax to `GraphQL` val api: GraphQL[Any] = ??? api.runServer( port = 8080, apiPath = "/api/graphql", graphiqlPath = Some("/graphiql") ) ``` ##### Server - Added `QuickAdapter` (see above) [#​1998](https://togithub.com/ghostdogpr/caliban/issues/1998) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed derivation of nested sum types with Scala 3 [#​2005](https://togithub.com/ghostdogpr/caliban/issues/2005) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed incorrect enum value renaming with Scala 3 [#​2006](https://togithub.com/ghostdogpr/caliban/issues/2006) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Optimized schema derivation with Scala 3 [#​1995](https://togithub.com/ghostdogpr/caliban/issues/1995) by [@​kyri-petrou](https://togithub.com/kyri-petrou) ##### Tools - Fixed incorrect interface description in server code gen [#​2000](https://togithub.com/ghostdogpr/caliban/issues/2000) by [@​ghostdogpr](https://togithub.com/ghostdogpr) ### [`v2.4.2`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.4.2) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.4.1...v2.4.2) ### Release Notes This version brings a few bug fixes as well as some performance improvements. Big thanks to [@​kyri-petrou](https://togithub.com/kyri-petrou) for his many contributions! ##### Server - Fixed schema renaming on recursive types [#​1974](https://togithub.com/ghostdogpr/caliban/issues/1974) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed schema renaming on interfaces [#​1978](https://togithub.com/ghostdogpr/caliban/issues/1978) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed schema derivation for nested sum types on Scala 3 [#​1991](https://togithub.com/ghostdogpr/caliban/issues/1991) [#​1994](https://togithub.com/ghostdogpr/caliban/issues/1994) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed an issue with `@defer` fields not working as expected when backed by DataSources [#​1981](https://togithub.com/ghostdogpr/caliban/issues/1981) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Improved performance of resolving large objects [#​1967](https://togithub.com/ghostdogpr/caliban/issues/1967) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Improved performance of jsoniter codecs [#​1979](https://togithub.com/ghostdogpr/caliban/issues/1979) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Improved interface field description [#​1976](https://togithub.com/ghostdogpr/caliban/issues/1976) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Used magnolia macros and reduced Scala 3 compilation time + codegen size [#​1952](https://togithub.com/ghostdogpr/caliban/issues/1952) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added a helper method for creating custom enum schemas [#​1953](https://togithub.com/ghostdogpr/caliban/issues/1953) by [@​kyri-petrou](https://togithub.com/kyri-petrou) ##### Tools - Fixed a warning about impure expression that could popup when using the compile time codegen [#​1965](https://togithub.com/ghostdogpr/caliban/issues/1965) by [@​satorg](https://togithub.com/satorg) ### [`v2.4.1`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.4.1) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.4.0...v2.4.1) ### 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](https://togithub.com/ghostdogpr/caliban/pull/1950)). ### [`v2.4.0`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.4.0) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.3.1...v2.4.0) ### 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](https://togithub.com/ghostdogpr/caliban/blob/a837bc7bef77262e84c81e67a107a854d1a00c74/examples/src/main/scala/example/ziohttp/ExampleApp.scala#L36-L40). > > This is a temporary workaround until a new version of `zio-http` is released which contains a fix to this issue. #### Server - Optimized core performance [#​1876](https://togithub.com/ghostdogpr/caliban/issues/1876) [#​1922](https://togithub.com/ghostdogpr/caliban/issues/1922) [#​1929](https://togithub.com/ghostdogpr/caliban/issues/1929) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added support for deprecated input fields (draft spec) [#​1932](https://togithub.com/ghostdogpr/caliban/issues/1932) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Added a wrapper for the new [Apollo Caching Protocol](https://www.apollographql.com/docs/apollo-server/performance/caching/). The old is now deprecated [#​1878](https://togithub.com/ghostdogpr/caliban/issues/1878) by [@​paulpdaniels](https://togithub.com/paulpdaniels) - Added a simple wrapper to check directives [#​1905](https://togithub.com/ghostdogpr/caliban/issues/1905) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Updated zio-query to the latest version so that it catches `die` errors happening inside the `DataSource` [#​1916](https://togithub.com/ghostdogpr/caliban/issues/1916) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Fixed `mocking up superclass for module class macros` warning on Scala 3 [#​1880](https://togithub.com/ghostdogpr/caliban/issues/1880) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed duplicate types being output when calling `render` on a schema [#​1888](https://togithub.com/ghostdogpr/caliban/issues/1888) by [@​nox213](https://togithub.com/nox213) - Used the latest version of Magnolia [#​1858](https://togithub.com/ghostdogpr/caliban/issues/1858) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Made Introspection introspectable [#​1900](https://togithub.com/ghostdogpr/caliban/issues/1900) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Removed old deprecated code [#​1902](https://togithub.com/ghostdogpr/caliban/issues/1902) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Added the option to disable tracing of pure fields in ApolloTracing wrapper [#​1907](https://togithub.com/ghostdogpr/caliban/issues/1907) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added the option to dynamically enable / disable ApolloTracing [#​1933](https://togithub.com/ghostdogpr/caliban/issues/1933) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Stopped generating a stack trace in `CalibanError` (not that `getCause` will return `null` in `ValidationError`) [#​1924](https://togithub.com/ghostdogpr/caliban/issues/1924) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Changed tracing span name to adhere to semantic guidelines [#​1875](https://togithub.com/ghostdogpr/caliban/issues/1875) by [@​Fluxx](https://togithub.com/Fluxx) - Fixed inline character escaping when rendering GraphQL [#​1936](https://togithub.com/ghostdogpr/caliban/issues/1936) by [@​paulpdaniels](https://togithub.com/paulpdaniels) #### Adapters - Added 100% compliance with [GraphQL over HTTP](https://graphql.github.io/graphql-over-http/) spec [#​1909](https://togithub.com/ghostdogpr/caliban/issues/1909) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Updated zio-http to RC2 [#​1910](https://togithub.com/ghostdogpr/caliban/issues/1910) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Enabled support for play-json in Scala 3 [#​1893](https://togithub.com/ghostdogpr/caliban/issues/1893) by [@​kyri-petrou](https://togithub.com/kyri-petrou) #### Tools - Properly escaped union types in client code generation [#​1908](https://togithub.com/ghostdogpr/caliban/issues/1908) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Fixed various things in server code generation [#​1925](https://togithub.com/ghostdogpr/caliban/issues/1925) by [@​oyvindberg](https://togithub.com/oyvindberg) - Added support for a `@lazy` directive to generate side-effecting fields in server code generation [#​1927](https://togithub.com/ghostdogpr/caliban/issues/1927) by [@​oyvindberg](https://togithub.com/oyvindberg) #### Federation - Added federation 2.5 support [#​1906](https://togithub.com/ghostdogpr/caliban/issues/1906) by [@​paulpdaniels](https://togithub.com/paulpdaniels) ### [`v2.3.1`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.3.1) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.3.0...v2.3.1) ### Release Notes This version contains important performance improvements as well as support for [Pekko](https://pekko.apache.org/). #### Server - Performance improvements - Drastically improved performance of the metrics wrapper [#​1850](https://togithub.com/ghostdogpr/caliban/issues/1850) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Optimized query execution by resolving fields lazily and prevent unnecessary work [#​1849](https://togithub.com/ghostdogpr/caliban/issues/1849) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Improved performance and correctness of schema and type rendering [#​1835](https://togithub.com/ghostdogpr/caliban/issues/1835) by [@​paulpdaniels](https://togithub.com/paulpdaniels) - Reduced size of the code generated by Schema derivation with Scala 3 [#​1830](https://togithub.com/ghostdogpr/caliban/issues/1830) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Optimized `VariableCoercer` [#​1856](https://togithub.com/ghostdogpr/caliban/issues/1856) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added support for auto enum derivation with Scala 3 [#​1834](https://togithub.com/ghostdogpr/caliban/issues/1834) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added a wrapper that allows skipping selected validation wrappers during introspection [#​1837](https://togithub.com/ghostdogpr/caliban/issues/1837) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed WS protocol by always returning an id upon errors [#​1845](https://togithub.com/ghostdogpr/caliban/issues/1845) by [@​SvenW](https://togithub.com/SvenW) - Added a helper `renderSchema` to render a schema without a resolver [#​1877](https://togithub.com/ghostdogpr/caliban/issues/1877) by [@​ghostdogpr](https://togithub.com/ghostdogpr) #### Adapters - Added support for Pekko [#​1862](https://togithub.com/ghostdogpr/caliban/issues/1862) by [@​MichelEdkrantz](https://togithub.com/MichelEdkrantz) ### [`v2.3.0`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.3.0) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.2.1...v2.3.0) ### Release Notes This version contains a lot of small fixes as well as performance and usability improvements. #### Server - Added fs2 stream interop [#​1737](https://togithub.com/ghostdogpr/caliban/issues/1737) by [@​satorg](https://togithub.com/satorg) - Added a helper to easily render the schema for a type [#​1759](https://togithub.com/ghostdogpr/caliban/issues/1759) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Optimized validation performance [#​1820](https://togithub.com/ghostdogpr/caliban/issues/1820) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added `status` label to the `graphql_fields_total` metric [#​1724](https://togithub.com/ghostdogpr/caliban/issues/1724) by [@​SvenW](https://togithub.com/SvenW) - Added validation of names in `validateSchema` [#​1731](https://togithub.com/ghostdogpr/caliban/issues/1731) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Added validation that root types are objects [#​1735](https://togithub.com/ghostdogpr/caliban/issues/1735) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Supported rendering of schema directives even if no queries/mutations/subscriptions [#​1742](https://togithub.com/ghostdogpr/caliban/issues/1742) by [@​yarian](https://togithub.com/yarian) - Improved efficiency of code when deriving `SemiAuto` [#​1785](https://togithub.com/ghostdogpr/caliban/issues/1785) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added support for interfaces implementing interfaces [#​1803](https://togithub.com/ghostdogpr/caliban/issues/1803) by [@​doohochang](https://togithub.com/doohochang) - Added support for schema descriptions [#​1808](https://togithub.com/ghostdogpr/caliban/issues/1808) by [@​nox213](https://togithub.com/nox213) - Fixed `fieldWithArgs` schema generation [#​1812](https://togithub.com/ghostdogpr/caliban/issues/1812) by [@​paulpdaniels](https://togithub.com/paulpdaniels) - Excluded fields with different arguments from interfaces [#​1815](https://togithub.com/ghostdogpr/caliban/issues/1815) by [@​kyri-petrou](https://togithub.com/kyri-petrou) #### Adapters - Allowed access to `ServerRequest` in `configure` [#​1816](https://togithub.com/ghostdogpr/caliban/issues/1816) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Cached creation of interpreter [#​1725](https://togithub.com/ghostdogpr/caliban/issues/1725) by [@​kyri-petrou](https://togithub.com/kyri-petrou) #### 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](https://togithub.com/ghostdogpr/caliban/issues/1732) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Added support for `derives Schema.SemiAuto` in schema code generation [#​1758](https://togithub.com/ghostdogpr/caliban/issues/1758) by [@​nox213](https://togithub.com/nox213) ### [`v2.2.1`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.2.1) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.2.0...v2.2.1) ### Release Notes This is a tiny release with a single change on `ZHttpAdapter` ([#​1723](https://togithub.com/ghostdogpr/caliban/issues/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`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.2.0) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.1.0...v2.2.0) ### 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](https://togithub.com/sponsors/ghostdogpr). 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`. ```scala // 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](https://togithub.com/ghostdogpr/caliban/blob/series/2.x/examples/src/main/scala/example/akkahttp/AuthExampleApp.scala#L51). 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). ```scala 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](https://togithub.com/ghostdogpr/caliban/issues/1707) by [@​ghostdogpr](https://togithub.com/ghostdogpr) #### Other changes ##### Server - Added experimental support for the `@defer` directive [#​1480](https://togithub.com/ghostdogpr/caliban/issues/1480) by [@​paulpdaniels](https://togithub.com/paulpdaniels) - Added directives parameter to `scalarSchema` [#​1694](https://togithub.com/ghostdogpr/caliban/issues/1694) by [@​yarian](https://togithub.com/yarian) - Added support for `derives ArgBuilder.GenAuto` derivation [#​1699](https://togithub.com/ghostdogpr/caliban/issues/1699) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added support for adding directives to individual enums [#​1663](https://togithub.com/ghostdogpr/caliban/issues/1663) by [@​paulpdaniels](https://togithub.com/paulpdaniels) - Fixed `derives Schema.Auto` derivation [#​1666](https://togithub.com/ghostdogpr/caliban/issues/1666) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed rendering of directives in arguments [#​1690](https://togithub.com/ghostdogpr/caliban/issues/1690) by [@​tusharmath](https://togithub.com/tusharmath) - Fixed repeatable directive introspection [#​1695](https://togithub.com/ghostdogpr/caliban/issues/1695) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Fixed propogation of directives in `objectSchema` [#​1698](https://togithub.com/ghostdogpr/caliban/issues/1698) by [@​yarian](https://togithub.com/yarian) ##### Client - Added support for Scala Native [#​1682](https://togithub.com/ghostdogpr/caliban/issues/1682) by [@​kyri-petrou](https://togithub.com/kyri-petrou) ##### Adapters - Upgraded zio-http to 3.0.0-RC1 [#​1705](https://togithub.com/ghostdogpr/caliban/issues/1705) by [@​jgulotta](https://togithub.com/jgulotta) ### [`v2.1.0`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.1.0) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.0.2...v2.1.0) ### 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: ```scala // 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): ```scala // 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](https://togithub.com/ghostdogpr/caliban/issues/1591) by [@​ghostdogpr](https://togithub.com/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: ```scala "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!): ```scala 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](https://togithub.com/ghostdogpr/caliban/issues/1552) by [@​kyri-petrou](https://togithub.com/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](https://togithub.com/com-lihaoyi/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](https://togithub.com/ghostdogpr/caliban/issues/1646) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Used `ZPure` instead of `ZIO` for validation logic, which improves validation performance greatly [#​1633](https://togithub.com/ghostdogpr/caliban/issues/1633) by [@​paulpdaniels](https://togithub.com/paulpdaniels) - Added multiple execution performance improvements in particular with fragments [#​1635](https://togithub.com/ghostdogpr/caliban/issues/1635) [#​1643](https://togithub.com/ghostdogpr/caliban/issues/1643) [#​1650](https://togithub.com/ghostdogpr/caliban/issues/1650) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Switched the internal JSON library used in Caliban Client from Circe to Jsoniter-scala for a better runtime performance [#​1639](https://togithub.com/ghostdogpr/caliban/issues/1639) by [@​paulpdaniels](https://togithub.com/paulpdaniels) #### Other changes ##### Server - Moved the `graphQL` function directly to the `caliban` package (the old one is still there but deprecated) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Added new wrappers for observability [#​1616](https://togithub.com/ghostdogpr/caliban/issues/1616) by [@​frekw](https://togithub.com/frekw) - `Wrappers.logSlowQueries` for logging slow queries with `ZIO.logWarning` - `Wrappers.metrics` for gathering metrics about query execution - `TracingWrapper.traced` for creating traces with OpenTelemetry (in a separate dependency `caliban-tracing`) - Reduced the size of the code generated by derivation (Scala 3 only) [#​1607](https://togithub.com/ghostdogpr/caliban/issues/1607) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Stopped adding the suffix `Input` to input objects that already have that suffix [#​1471](https://togithub.com/ghostdogpr/caliban/issues/1471) by [@​brodin](https://togithub.com/brodin) - Prevented validation error when an input field is null but a default value exists [#​1629](https://togithub.com/ghostdogpr/caliban/issues/1629) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Stopped requiring a `Schema` for fields annotated with `@GQLExcluded` (Scala 3 only) [#​1630](https://togithub.com/ghostdogpr/caliban/issues/1630) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Added support for repeatable directives [#​1617](https://togithub.com/ghostdogpr/caliban/issues/1617) by [@​jgulotta](https://togithub.com/jgulotta) - Added the ability to skip query validation in wrappers (used in `ApolloPersistedQueries` wrapper) [#​1557](https://togithub.com/ghostdogpr/caliban/issues/1557) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed rendering of directive arguments that contain special characters [#​1656](https://togithub.com/ghostdogpr/caliban/issues/1656) by [@​camarena](https://togithub.com/camarena) - Added `isIntrospection` field on `Document` [#​1662](https://togithub.com/ghostdogpr/caliban/issues/1662) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Fixed the Monix interop that had been broken by an older release [#​1628](https://togithub.com/ghostdogpr/caliban/issues/1628) by [@​ghostdogpr](https://togithub.com/ghostdogpr) ##### Adapters - Upgraded zio-http dependency to 0.0.5 (this is using the new organization) [#​1521](https://togithub.com/ghostdogpr/caliban/issues/1521) by [@​frekw](https://togithub.com/frekw) ##### Federation - Added support for federation v2.3 [#​1631](https://togithub.com/ghostdogpr/caliban/issues/1631) by [@​paulpdaniels](https://togithub.com/paulpdaniels) ##### Tools - Fixed client code generation for interfaces [#​1559](https://togithub.com/ghostdogpr/caliban/issues/1559) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Made the introspection `SelectionBuilder` public [#​1596](https://togithub.com/ghostdogpr/caliban/issues/1596) by [@​lassebn](https://togithub.com/lassebn) ### [`v2.0.2`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.0.2) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.0.1...v2.0.2) ### Release Notes This release contains several bug fixes and dependency upgrades (see [versions here](https://togithub.com/ghostdogpr/caliban/blob/3d08723772622578a944e183df85de25e26f14b1/build.sbt#L9)), as well as support for the [Jsoniter](https://jsoniter.com) Json library. This library is optimized for performance so the encoding/decoding of GraphQL requests/responses consumes less memory and is significantly faster than other solutions. Note that for performance reasons, this implementation is not tail-recursive so you might want to limit query depth with the `maxDepth` wrapper. Give it a try if you're looking for the best possible throughput! #### Server - Added support for Jsoniter [#​1527](https://togithub.com/ghostdogpr/caliban/issues/1527) by [@​kyri-petrou](https://togithub.com/kyri-petrou) - Made `RequestInterceptor.empty` a `val`, so that we don't instantiate many of them [#​1435](https://togithub.com/ghostdogpr/caliban/issues/1435) by [@​guizmaii](https://togithub.com/guizmaii) - Ensured `String` is returned by introspection even when it's not used [#​1444](https://togithub.com/ghostdogpr/caliban/issues/1444) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Added support for `VARIABLE_DEFINITION` as a possible directive location [#​1446](https://togithub.com/ghostdogpr/caliban/issues/1446) by [@​aadunn](https://togithub.com/aadunn) - Improved performance by move primitives to `RootType` [#​1508](https://togithub.com/ghostdogpr/caliban/issues/1508) by [@​frekw](https://togithub.com/frekw) - Fixed rendering of descriptions for multi-line descriptions ending in quote [#​1544](https://togithub.com/ghostdogpr/caliban/issues/1544) by [@​camarena](https://togithub.com/camarena) #### Adapters - Fixed ping/pong handler in tapir websocket protocol [#​1458](https://togithub.com/ghostdogpr/caliban/issues/1458) by [@​rolang](https://togithub.com/rolang) - Fixed `WebSocket.afterInit` [#​1515](https://togithub.com/ghostdogpr/caliban/issues/1515) by [@​ghostdogpr](https://togithub.com/ghostdogpr) #### Federation - Made entity resolvers support partial responses and errors combined [#​1437](https://togithub.com/ghostdogpr/caliban/issues/1437) by [@​SvenW](https://togithub.com/SvenW) #### Tools - Fixed scalafmt newline issue [#​1518](https://togithub.com/ghostdogpr/caliban/issues/1518) by [@​jfwilson](https://togithub.com/jfwilson) - Allowed specifying a scalar mapping for ID in client codegen [#​1529](https://togithub.com/ghostdogpr/caliban/issues/1529) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Made codegen valid on scala 3 when a field is named `_` [#​1540](https://togithub.com/ghostdogpr/caliban/issues/1540) by [@​guymers](https://togithub.com/guymers) ### [`v2.0.1`](https://togithub.com/ghostdogpr/caliban/releases/tag/v2.0.1) [Compare Source](https://togithub.com/ghostdogpr/caliban/compare/v2.0.0...v2.0.1) ### Release Notes #### Server - Fixed the annotations macro on Scala 3 which caused runtime errors when using `Schema` for `java.time` on JDK 17 [#​1414](https://togithub.com/ghostdogpr/caliban/issues/1414) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Prevented validation errors during variable coercion when `skipValidation` is true [#​1421](https://togithub.com/ghostdogpr/caliban/issues/1421) by [@​ghostdogpr](https://togithub.com/ghostdogpr) - Upgraded zio-query to 0.3.1, which brings a performance improvement in some cases (thanks to [@​adamgfraser](https://togithub.com/adamgfraser)) #### Adapters - Fixed http4s websocket support that was broken in the last release [#​1417](https://togithub.com/ghostdogpr/caliban/issues/1417) by [@​ghostdogpr](https://togithub.com/ghostdogpr) #### Tools - Added Scala 3 support for caliban-tools, making the compile-time plugin usable [#​1415](https://togithub.com/ghostdogpr/caliban/issues/1415) by [@​pmeheut](https://togithub.com/pmeheut)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.

renovate[bot] commented 1 year ago

Branch automerge failure

This PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead.