Skip to content

Instantly share code, notes, and snippets.

@malshash
Created February 12, 2017 02:18
Show Gist options
  • Save malshash/9b8eda276d2920649a07dbd43fcc4f9f to your computer and use it in GitHub Desktop.
Save malshash/9b8eda276d2920649a07dbd43fcc4f9f to your computer and use it in GitHub Desktop.
func fetchData(completion: @escaping () -> Void) {
// RestClientSuccessBlock onSuccess = ^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
// NSDictionary *resultDict = [mappingResult dictionary];
//
// dispatch_async(dispatch_get_main_queue(), ^{
//
// [self handleResponse:resultDict error:nil];
//
// if(completion) {
// completion();
// }
//
// });
// };
//
// RestClientFailureBlock onFailure = ^(RKObjectRequestOperation *operation, NSError *error) {
// NSLog(@"Hit error: %@ with operation: %@", error.localizedDescription, operation);
// dispatch_async(dispatch_get_main_queue(), ^{
// [self handleResponse:nil error:error];
// });
// };
let leadId = self.lead!.id
let queryString: String = GraphQLHelper.leadNotes(withLeadId: leadId)
let params: [String: String] = ["query": queryString]
PortalClient.sharedInstance().graphqlPost(withParameters: params, success: onSuccess, failure: onFailure ))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment