我正在尝试使用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