apollo-android v3.2.1 Release Notes
-
2022-04-05
๐ This release introduces a few improvements and bug fixes.
โจ๏ธ [new]
ApolloCall<D>.emitCacheMisses(Boolean)
(#3980)When observing the cache with
watch
, the behavior was to not emit cache misses at all, which may not desirable in certain cases. With this new option, you can now choose to emit them: in that case responses will be emitted with a nulldata
.This can be used like so:
apolloClient.query(query) .fetchPolicy(FetchPolicy.CacheOnly) .emitCacheMisses(true) .watch() .collect { response -> // response.data will be null in case of cache misses }
This is also closer to the behavior that was in place in v2. Many thanks to @mateuszkwiecinski for the insights and raising the issue!
๐ง โ๏ธ [breaking] Allow configuration of frame types used in
SubscriptionWsProtocol
and default to Text (#3992)0๏ธโฃ When using subscriptions over WebSockets with
SubscriptionWsProtocol
(the default), the frames were sent in the binary format. It was reported that this was not compatible with certain servers (DGS , graphql-java-kickstart) that are expecting text 0๏ธโฃ frames. This is now fixed and the default is to send text frames.โ ๏ธ This may be a breaking change if your server expects binary frames only!
๐ง If that is the case, you can use the new
frameType
option to configure the frame type to be sent:client = ApolloClient.Builder() .webSocketServerUrl("wss://...") .wsProtocol(GraphQLWsProtocol.Factory(frameType = WsFrameType.Binary)) .build()
Many thanks to @Krillsson and @aviewfromspace1 for the insights and raising the issue!
๐ทโ All changes
- ๐ Allow configuration of frame types used in SubscriptionWsProtocol and default to Text (#3992)
- โ add
ApolloRequest.newBuilder(operation: Operation<E>)
(#3988) - โ Add exception handlers to ApolloCacheInterceptor and SqlNormalizedCache (#3989)
- ๐ ๐ Fix some @DeprecatedSince annotations (#3983)
- ๐ add ApolloCall.emitCacheMisses(Boolean) (#3980)
- โ๏ธ Fix fragments on the root query type in operationBased codegen (#3973)
โค๏ธ External contributors
Many thanks to @AdamMTGreenberg and @Krillsson for the contributions! ๐