GraphQLRequest
public struct GraphQLRequest<R> where R : Decodable
GraphQL Request
-
The name of graphQL API being invoked, as specified in
amplifyconfiguration.json. Specify this parameter when more than one GraphQL API is configured.Declaration
Swift
public let apiName: String? -
Query document
Declaration
Swift
public let document: String -
Query variables
Declaration
Swift
public let variables: [String : Any]? -
Type to decode the graphql response data object to
Declaration
Swift
public let responseType: R.Type -
The authorization mode
Declaration
Swift
public let authMode: AuthorizationMode? -
The path to decode to the graphQL response data to
responseType. Delimited by.The decode path “listTodos.items” will traverse to the object atlistTodos, and decode the object atitemstoresponseTypeThe data at that decode path is a list of Todo objects soresponseTypeshould be[Todo].selfDeclaration
Swift
public let decodePath: String? -
Options to adjust the behavior of this request, including plugin-options
Declaration
Swift
public var options: Options? -
Declaration
Swift
public init( apiName: String? = nil, document: String, variables: [String: Any]? = nil, responseType: R.Type, decodePath: String? = nil, authMode: AuthorizationMode? = nil, options: GraphQLRequest<R>.Options? = nil )
View on GitHub