Created
May 24, 2019 20:00
-
-
Save mobilequickie/9f8b74d399540d5264f71d45b315c5ba to your computer and use it in GitHub Desktop.
RDSDemo - GraphQL Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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