Skip to content

Instantly share code, notes, and snippets.

@mobilequickie
Last active May 24, 2019 19:41
Show Gist options
  • Save mobilequickie/ac74137dcf60ab6569804d205ef38a93 to your computer and use it in GitHub Desktop.
Save mobilequickie/ac74137dcf60ab6569804d205ef38a93 to your computer and use it in GitHub Desktop.
RDSDemo for GraphQL mutation for iOS
// GraphQL Mutation - Add a new AWS Service to the MyAWSService database table
func createServiceMutation(){
// A quick sample insert
let createServiceInput = CreateAWSServiceInput(id: 6, shortName: "Device Farm", longName: "AWS Device Farm", serviceRegionName: "aws-device-farm-us-west-2", imageUrl: "device-farm")
appSyncClient?.perform(mutation: CreateAwsServiceMutation(createAWSServiceInput: createServiceInput)) {
(result, error) in
if let error = error as? AWSAppSyncClientError {
print("Error occurred: \(error.localizedDescription )")
}
if let resultError = result?.errors {
print("Error saving conf talk: \(resultError)")
return
}
guard let result = result?.data else { return }
self.getServicesQuery()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment