import Foundation
import SwiftUI
import Amplify
class MovesAPI: ObservableObject {
@Published var todoLIst: [MoveType?] = [nil]
init() {
listTodos()
}
func listTodos() -> AnyCancellable { //cannot find type 'AnyCancellable' in scope
let moveType = MoveType.keys
let sink = Amplify.API.query(request: .paginatedList(MoveType.self)) //Generic parameter 'R' could not be inferred //Type 'GraphQLRequest<_>' has no member 'paginatedList'
.resultPublisher
.sink {
if case let .failure(error) = $0 {
print("Got failed event with error \(error)")
}
}
receiveValue: { result in
switch result {
case .success(let …
Run Code Online (Sandbox Code Playgroud)