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 using subscriptionManager.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 ๐Ÿ”ง with downloadApolloSchema ๐Ÿ”ง , 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).