apollo-android v3.3.0 Release Notes
-
2022-05-04
๐ This is the first release with HMPP support. If you're using โก๏ธ multiplatform, updating to Kotlin 1.6.21 is strongly encouraged.
๐ This release also brings WebSocket related improvements and other fixes!
โจ๏ธ [new] Hierarchical MultiPlatform Project (HMPP) (#4033)
๐ When using Apollo Kotlin on a multiplatform project, this release is compatible with ๐ the hierarchical project structure, which makes it easier to ๐ share common code among several targets. Using HMPP in your project also fixes some issues when compiling Kotlin ๐ metadata. See https://github.com/apollographql/apollo-kotlin/issues/4019 and https://youtrack.jetbrains.com/issue/KT-51970/ for more details.
โ Note: If you're using multiplatform, we strongly encourage updating to Kotlin 1.6.21. If that is not an option, you might have issues resolving dependencies. More infos in this issue.
โจ๏ธ [new]
WebSocketNetworkTransport.closeConnection
(#4049)This new method can be used in conjunction ๐ with
reopenWhen
to force a reconnection to the server. This could be useful for instance when needing to pass new auth tokens in the headers. If you were usingsubscriptionManager.reconnect()
in 2.x,closeConnection
is a simple way to achieve the same behaviour.๐ฐ โจ๏ธ [new]
GraphQLWsProtocol.connectionPayload
is now a lambda (#4043)๐ฐ With
GraphQLWsProtocol
, if you need to pass parameters to the connection payload, previously you would pass them as a ๐ static map to the builder. With this change you can now pass a lambda providing them as needed. This facilitates passing fresh auth tokens when connecting.โจ๏ธ [new] Add insecure option to download schema (#4021)
You can now use the
--insecure
flag when downloading a schema ๐ง withdownloadApolloSchema
๐ง , to bypass the certificate check, which can be useful if a server is configured with a self-signed certificate for instance.๐ทโ All changes
- โ Add WebSocketNetworkTransport.closeConnection (#4049)
- ๐ฐ Made connectionPayload as suspend function in GraphQLWsProtocol (#4043)
- โก Ignore unknown websocket messages (#4066)
- Kotlin 1.6.21 & HMPP (#4033)
- Provide a Content-Length when using Upload (#4056)
- โ๏ธ add HttpRequest.newBuilder(url, method) (#4038)
- Escape enum constants (#4035)
- ๐ Fix the Moshi adapter used for OperationOutput. Moshi cannot get the type parameters from the typealias automagically (#4022)
- โ Add insecure option to download schema (#4021)
- Try to reduce allocations in MapJsonReader (#3935)
- โ ๐ Deprecate BearerTokenInterceptor and provide tests and docs instead (#4068)
โค๏ธ External contributors
๐ Many thanks to @CureleaAndrei and @kdk96 for contributing to this release! ๐
๐ โ๏ธ Deprecations
BearerTokenInterceptor
was provided as an example but is too simple for most use cases, and has therefore been deprecated in this release. This page provides more details about authentication.- ๐ The previous ways of passing parameters to the connection payload with
GraphQLWsProtocol
has been deprecated (see above).