使用AWS应用程序同步的快速IOS应用程序中的GraphQL查询未执行(跳过)

时间:2019-06-04 11:19:06

标签: ios swift graphql aws-appsync

我正在尝试使用iOS应用程序中的AWS App同步代码生成功能查询dynamoDB。 DynamoDB解析器也已创建。我可以从应用同步浏览器中查询表,但是,当我执行代码时,查询语句只是被跳过了……或什么也不做。

func queryProfile() {
        print("I Am Here1")
        //appSyncClient?.fetch(query: GetSkill2CustomerEvQuery(skill: "Doctor")) { result, error in
        //appSyncClient?.fetch(query: ListSkill2CustomerEvsQuery()) { (result, error) in
        appSyncClient?.fetch(query: GetSkill2CustomerEvQuery(skill: "Doctor"), cachePolicy: .returnCacheDataAndFetch)  { (result, error) in
        if error != nil {
                print("I Am Here3")
                print(error?.localizedDescription ?? "")
                return
            }

            print("I Am Here2")
            print(result.debugDescription)
           // print(result?.data?.getSkill2CustomerEv?.userId! as Any)
        }
        print("I Am Here4")
    }
 output: 
 I Am Here1
 I Am Here4

0 个答案:

没有答案