APICategoryGraphQLBehavior
public protocol APICategoryGraphQLBehavior : AnyObject
Behavior of the API category related to GraphQL operations
-
query(request:Asynchronous) Perform a GraphQL query operation against a previously configured API. This operation will be asynchronous, with the callback accessible both locally and via the Hub.
Declaration
Swift
func query<R>(request: GraphQLRequest<R>) async throws -> GraphQLTask<R>.Success where R : DecodableParameters
requestThe GraphQL request containing apiName, document, variables, and responseType
listenerThe event listener for the operation
Return Value
The AmplifyOperation being enqueued
-
mutate(request:Asynchronous) Perform a GraphQL mutate operation against a previously configured API. This operation will be asynchronous, with the callback accessible both locally and via the Hub.
Declaration
Swift
func mutate<R>(request: GraphQLRequest<R>) async throws -> GraphQLTask<R>.Success where R : DecodableParameters
requestThe GraphQL request containing apiName, document, variables, and responseType
listenerThe event listener for the operation
Return Value
The AmplifyOperation being enqueued
-
Perform a GraphQL subscribe operation against a previously configured API. This operation will be asychronous, with the callback accessible both locally and via the Hub.
Declaration
Swift
func subscribe<R: Decodable>( request: GraphQLRequest<R> ) -> AmplifyAsyncThrowingSequence<GraphQLSubscriptionEvent<R>>Parameters
requestThe GraphQL request containing apiName, document, variables, and responseType
valueListenerInvoked when the GraphQL subscription receives a new value from the service
completionListenerInvoked when the subscription has terminated
Return Value
The AmplifyInProcessReportingOperation being enqueued
View on GitHub