-
Notifications
You must be signed in to change notification settings - Fork 730
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
Network Rearchitecture #1341
Network Rearchitecture #1341
Conversation
6172015
to
df6024d
Compare
91c9c47
to
0bde055
Compare
6af46dc
to
515b1db
Compare
import Foundation | ||
|
||
/// An error interceptor called to allow further examination of error data when an error occurs in the chain. | ||
public protocol ApolloErrorInterceptor { |
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.
I'm not sure if it would work, but what do you think of instead using protocol for this interceptor, actually, use just a function. For instance,
typealias ApolloErrorInterceptor = (Error,
RequestChain,
HTTPRequest<Operation>,
HTTPResponse<Operation>?,
@escaping (Result<GraphQLResult<Operation.Data>, Error>) -> Void)) -> Void
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.
I would wayyyyyy rather have this as a protocol, particularly since it gives longer term flexibility to add more methods if needed.
af574ef
to
1dd71de
Compare
extension GraphQLResult where Data: Decodable { | ||
|
||
public init<T: FlexibleDecoder>(from data: Foundation.Data, decoder: T) throws { | ||
// SWIFT CODEGEN: fix this to handle codable better |
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.
Thoroughly punting on this for now.
A preview of the updated networking setup instructions can be found here. Going to be updating the tutorial portion dealing with these changes before cutting a beta. Would love feedback! |
ca3b14d
to
385be42
Compare
…dedupe callbacks for the watcher.
…entifier for watcher context vs identifier for actual URLSessionTask
…lo store subscriber for future reference
… retry interceptor
… with request chain
385be42
to
38135ee
Compare
OK, pointing this at |
This PR relates to the RFC for the new networking stack - this branch is basically where I've been doing explorations thus far.