APICategory
final public 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 }
-
true
if this category has been configured withAmplify.configure()
.Warning
This property is intended for use by plugin developers.Declaration
Swift
public var isConfigured: Bool
-
Adds
plugin
to the list of Plugins that implement functionality for this category.Declaration
Swift
public func add(plugin: APICategoryPlugin) throws
Parameters
plugin
The Plugin to add
-
Returns the added plugin with the specified
key
property.Declaration
Swift
public func getPlugin(for key: PluginKey) throws -> APICategoryPlugin
Parameters
key
The PluginKey (String) of the plugin to retrieve
Return Value
The wrapped plugin
-
Removes the plugin registered for
key
from 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
key
The key used to
add
the 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() -> APIAuthProviderFactory
Return 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
-
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
reachabilityPublisher
to delegate to plugin’s methodDeclaration
Swift
public func reachabilityPublisher(for apiName: String?) throws -> AnyPublisher<ReachabilityUpdate, Never>?
-
Default implementation of
reachabilityPublisher
to delegate to plugin’s methodDeclaration
Swift
public func reachabilityPublisher() throws -> AnyPublisher<ReachabilityUpdate, Never>?
-
reset()
AsynchronousDeclaration
Swift
public func reset() async