@@ -47,6 +47,7 @@ public protocol HTTPNetworkTransportTaskCompletedDelegate: HTTPNetworkTransportD
4747
4848// MARK: -
4949
50+ /// Methods which will be called if an error is receieved at the network level.
5051public protocol HTTPNetworkTransportRetryDelegate : HTTPNetworkTransportDelegate {
5152
5253 /// Called when an error has been received after a request has been sent to the server to see if an operation should be retried or not.
@@ -65,12 +66,19 @@ public protocol HTTPNetworkTransportRetryDelegate: HTTPNetworkTransportDelegate
6566 retryHandler: @escaping ( _ shouldRetry: Bool ) -> Void )
6667}
6768
68- /// Methods which will be called after some kind of response has been received and it contains GraphQLErrors
69- public protocol HTTPNetworkTransportGraphQLErrorDelegate : HTTPNetworkTransportDelegate {
69+ // MARK: -
7070
71+ /// Methods which will be called after some kind of response has been received and it contains GraphQLErrors.
72+ public protocol HTTPNetworkTransportGraphQLErrorDelegate : HTTPNetworkTransportDelegate {
7173
7274 /// Called when response contains one or more GraphQL errors.
73- /// NOTE: Don't just call the `retryHandler` with `true` all the time, or you can potentially wind up in an infinite loop of errors
75+ ///
76+ /// NOTE: The mere presence of a GraphQL error does not necessarily mean a request failed!
77+ /// GraphQL is design to allow partial success/failures to return, so make sure
78+ /// you're validating the *type* of error you're getting in this before deciding whether to retry or not.
79+ ///
80+ /// ALSO NOTE: Don't just call the `retryHandler` with `true` all the time, or you can
81+ /// potentially wind up in an infinite loop of errors
7482 ///
7583 /// - Parameters:
7684 /// - networkTransport: The network transport which received the error
@@ -79,7 +87,6 @@ public protocol HTTPNetworkTransportGraphQLErrorDelegate: HTTPNetworkTransportDe
7987 func networkTransport( _ networkTransport: HTTPNetworkTransport , receivedGraphQLErrors errors: [ GraphQLError ] , retryHandler: @escaping ( _ shouldRetry: Bool ) -> Void )
8088}
8189
82-
8390// MARK: -
8491
8592/// A network transport that uses HTTP POST requests to send GraphQL operations to a server, and that uses `URLSession` as the networking implementation.
0 commit comments