Skip to content

Commit

Permalink
update interceptor doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Di Wu committed Sep 12, 2023
1 parent a6e0df8 commit 57da7c8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ import Amplify
import Foundation
import AWSPluginsCore

/// The order of interceptor decoration is as follows:
/// 1. **prelude interceptors**
/// 2. **cutomize headers**
/// 3. **customer interceptors**
/// 4. **postlude interceptors**
///
/// **Prelude** and **postlude** interceptors are used by library maintainers to
/// integrate essential functionality for a variety of authentication types.
struct AWSAPIEndpointInterceptors {
// API name
let apiEndpointName: APIEndpointName

let apiAuthProviderFactory: APIAuthProviderFactory
let authService: AWSAuthServiceBehavior?

/// The order of interceptor decoration is as follows:
/// 1. **prelude interceptors**: append default auth info
/// 2. **cutomize headers**: headers provided when constructing the request
/// 3. **customer interceptors**: customer defined interceptors
/// 4. **postlude interceptors**: calculate checksums, signatures
var preludeInterceptors: [URLRequestInterceptor] = []

var interceptors: [URLRequestInterceptor] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ final public class AWSGraphQLOperation<R: Decodable>: GraphQLOperation<R> {
} catch {
return .failure(
APIError.operationError(
"Failed to intercept request fully.",
"Something wrong with the interceptor",
"Failed to intercept request with \(type(of: interceptor)). Error message: \(error.localizedDescription).",
"See underlying error for more details",
error
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ final public class AWSRESTOperation: AmplifyOperation<
} catch {
return .failure(
APIError.operationError(
"Failed to intercept request fully.",
"Something wrong with the interceptor",
"Failed to intercept request with \(type(of: interceptor)). Error message: \(error.localizedDescription).",
"See underlying error for more details",
error
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension GraphQLModelBasedTests {
let post = Post.keys
let predicate = post.id == uuid1 || post.id == uuid2
var results: List<Post>?
let response = try await Amplify.API.query(request: .list(Post.self, where: predicate, limit: 1))
let response = try await Amplify.API.query(request: .list(Post.self, where: predicate, limit: 3000))

guard case .success(let graphQLresponse) = response else {
XCTFail("Missing successful response")
Expand Down

0 comments on commit 57da7c8

Please sign in to comment.