Last active
May 24, 2019 19:41
-
-
Save mobilequickie/ac74137dcf60ab6569804d205ef38a93 to your computer and use it in GitHub Desktop.
RDSDemo for GraphQL mutation for iOS
This file contains hidden or 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 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