-
Notifications
You must be signed in to change notification settings - Fork 655
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
Do not throw in Flows #4685
Do not throw in Flows #4685
Conversation
✅ Deploy Preview for apollo-android-docs canceled.
|
1cedd6c
to
2e4bbd6
Compare
libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/ApolloResponse.kt
Outdated
Show resolved
Hide resolved
...runtime/src/commonMain/kotlin/com/apollographql/apollo3/network/http/HttpNetworkTransport.kt
Outdated
Show resolved
Hide resolved
...ting-support/src/commonMain/kotlin/com/apollographql/apollo3/testing/TestNetworkTransport.kt
Outdated
Show resolved
Hide resolved
...ting-support/src/commonMain/kotlin/com/apollographql/apollo3/testing/TestNetworkTransport.kt
Outdated
Show resolved
Hide resolved
...ting-support/src/commonMain/kotlin/com/apollographql/apollo3/testing/TestNetworkTransport.kt
Show resolved
Hide resolved
libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo3/ApolloCall.kt
Outdated
Show resolved
Hide resolved
d4b55be
to
e5fb47e
Compare
libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/ExecutionOptions.kt
Outdated
Show resolved
Hide resolved
a78886f
to
3f535e9
Compare
libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/ApolloResponse.kt
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
...pollo-http-cache/src/main/kotlin/com/apollographql/apollo3/cache/http/HttpCacheExtensions.kt
Show resolved
Hide resolved
.../src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/FetchPolicyInterceptors.kt
Outdated
Show resolved
Hide resolved
libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo3/ApolloCall.kt
Outdated
Show resolved
Hide resolved
libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo3/ApolloCall.kt
Outdated
Show resolved
Hide resolved
.exception(AutoPersistedQueriesNotSupported()) | ||
.build() | ||
) | ||
return@flow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
...s/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo3/network/NetworkTransport.kt
Outdated
Show resolved
Hide resolved
007a593
to
929aef6
Compare
libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/ApolloResponse.kt
Outdated
Show resolved
Hide resolved
libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/ApolloResponse.kt
Show resolved
Hide resolved
...ng/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
.../src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/FetchPolicyInterceptors.kt
Outdated
Show resolved
Hide resolved
.../src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/FetchPolicyInterceptors.kt
Show resolved
Hide resolved
libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo3/ApolloCall.kt
Outdated
Show resolved
Hide resolved
libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo3/ApolloCall.kt
Outdated
Show resolved
Hide resolved
*/ | ||
fun <T> MutableExecutionOptions<T>.emitCacheMisses(emitCacheMisses: Boolean) = addExecutionContext( | ||
EmitCacheMissesContext(emitCacheMisses) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it with DeprecationLevel.ERROR
and a nice error message?
fun <D : Query.Data> ApolloCall<D>.watch( | ||
fetchThrows: Boolean = false, | ||
refetchThrows: Boolean = false, | ||
): Flow<ApolloResponse<D>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the overload with DeprecationLevel.ERROR
?
@@ -28,7 +27,6 @@ import com.apollographql.apollo3.interceptor.ApolloInterceptor | |||
import com.apollographql.apollo3.interceptor.ApolloInterceptorChain | |||
import com.apollographql.apollo3.mpp.currentTimeMillis | |||
import kotlinx.coroutines.flow.Flow | |||
import kotlinx.coroutines.flow.catch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a maybeWriteToCache
in this file that certainly needs to check for response.exception
before writing to the cache?
libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo3/ApolloCall.kt
Show resolved
Hide resolved
…lloCompositeException
Also, keep some methods around instead of deleting them, with Error level deprecation, for binary compatibility.
...he/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/ClientCacheExtensions.kt
Outdated
Show resolved
Hide resolved
…ported watch methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
See #4003.
WebSocketNetworkTransport
ApolloCacheInterceptor
,FetchPolicyInterceptor
, andApolloCall,execute()
accordinglyThrowingXyzInterceptor
s, and athrowApolloException
parameter ontoFlow
are added to get the old behavior backMissing:
ApolloCallback.onFailure
and only keeponResponse
since reponse can have an exception