APICategory
public final class APICategory : Category
extension APICategory: DefaultLogger
extension APICategory: APICategoryAuthProviderFactoryBehavior
extension APICategory: APICategoryGraphQLBehavior
extension APICategory: APICategoryInterceptorBehavior
extension APICategory: APICategoryRESTBehavior
extension APICategory: APICategoryReachabilityBehavior
extension APICategory: Resettable
The API category provides a solution for making HTTP requests to REST and GraphQL endpoints.
-
The category type for API
Declaration
Swift
public var categoryType: CategoryType { get } -
trueif this category has been configured withAmplify.configure().Warning
This property is intended for use by plugin developers.Declaration
Swift
public var isConfigured: Bool
-
Adds
pluginto the list of Plugins that implement functionality for this category.Declaration
Swift
public func add(plugin: APICategoryPlugin) throwsParameters
pluginThe Plugin to add
-
Returns the added plugin with the specified
keyproperty.Declaration
Swift
public func getPlugin(for key: PluginKey) throws -> APICategoryPluginParameters
keyThe PluginKey (String) of the plugin to retrieve
Return Value
The wrapped plugin
-
Removes the plugin registered for
keyfrom the list of Plugins that implement functionality for this category. If no plugin has been added forkey, no action is taken, making this method safe to call multiple times.Declaration
Swift
public func removePlugin(for key: PluginKey)Parameters
keyThe key used to
addthe plugin -
Declaration
Swift
public static var log: Logger { get } -
Declaration
Swift
public var log: Logger { get } -
Retrieve the plugin’s auth provider factory
Declaration
Swift
public func apiAuthProviderFactory() -> APIAuthProviderFactoryReturn Value
auth provider factory
-
query(request:Asynchronous) Declaration
Swift
public func query<R>(request: GraphQLRequest<R>) async throws -> GraphQLTask<R>.Success where R : Decodable -
mutate(request:Asynchronous) Declaration
Swift
public func mutate<R>(request: GraphQLRequest<R>) async throws -> GraphQLTask<R>.Success where R : Decodable -
Declaration
Swift
public func subscribe<R>(request: GraphQLRequest<R>) -> AmplifyAsyncThrowingSequence<GraphQLSubscriptionEvent<R>> where R : Decodable, R : Sendable -
Declaration
Swift
public func add(interceptor: URLRequestInterceptor, for apiName: String) throws -
get(request:Asynchronous) Declaration
Swift
public func get(request: RESTRequest) async throws -> RESTTask.Success -
put(request:Asynchronous) Declaration
Swift
public func put(request: RESTRequest) async throws -> RESTTask.Success -
post(request:Asynchronous) Declaration
Swift
public func post(request: RESTRequest) async throws -> RESTTask.Success -
delete(request:Asynchronous) Declaration
Swift
public func delete(request: RESTRequest) async throws -> RESTTask.Success -
head(request:Asynchronous) Declaration
Swift
public func head(request: RESTRequest) async throws -> RESTTask.Success -
patch(request:Asynchronous) Declaration
Swift
public func patch(request: RESTRequest) async throws -> RESTTask.Success -
Default implementation of
reachabilityPublisherto delegate to plugin’s methodDeclaration
Swift
public func reachabilityPublisher(for apiName: String?) throws -> AnyPublisher<ReachabilityUpdate, Never>? -
Default implementation of
reachabilityPublisherto delegate to plugin’s methodDeclaration
Swift
public func reachabilityPublisher() throws -> AnyPublisher<ReachabilityUpdate, Never>? -
reset()AsynchronousDeclaration
Swift
public func reset() async
View on GitHub