Skip to content

Instantly share code, notes, and snippets.

@mobilequickie
Created May 24, 2019 20:00
Show Gist options
  • Save mobilequickie/9f8b74d399540d5264f71d45b315c5ba to your computer and use it in GitHub Desktop.
Save mobilequickie/9f8b74d399540d5264f71d45b315c5ba to your computer and use it in GitHub Desktop.
RDSDemo - GraphQL Query
// GraphQL Query - List all AWS Services from MyAWSServices Table
// Returned cached list and then fetch
func getServicesQuery(){
appSyncClient?.fetch(query: ListAwsServicesQuery(), cachePolicy: .returnCacheDataAndFetch) { (result, error) in
if error != nil {
print(error?.localizedDescription ?? "")
return
}
guard let services = result?.data?.listAwsServices else { return }
self.awsServices = services as! [ListAwsServicesQuery.Data.ListAwsService]
self.tableView.reloadData()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment