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 path to decode to the graphQL response data to responseType. Delimited by . The decode path “listTodos.items” will traverse to the object at listTodos, and decode the object at items to responseType The data at that decode path is a list of Todo objects so responseType should be [Todo].self

    Declaration

    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,
                options: GraphQLRequest<R>.Options? = nil)

GraphQLRequest + Options