├── FILE_LICENSE
├── Apollo_OC
├── Assets.xcassets
│ ├── first.imageset
│ │ ├── first.pdf
│ │ └── Contents.json
│ ├── second.imageset
│ │ ├── second.pdf
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── FirstViewController.h
├── SecondViewController.h
├── Apollo
│ ├── NSMutableArray+Concat.h
│ ├── NSSet+Disjoint.h
│ ├── Cancellable.m
│ ├── NSHTTPURLResponse+Utilities.h
│ ├── NSMutableArray+Concat.m
│ ├── CacheKeyForObject.h
│ ├── Cancellable.h
│ ├── GraphQLTypes.m
│ ├── JSONSerializationFormat.h
│ ├── JSONStandardTypeConversions.h
│ ├── NSDictionary+JSONEncodable.h
│ ├── NSHTTPURLResponse+Utilities.m
│ ├── NSArray+Map.h
│ ├── OperationResultHandler.h
│ ├── NetworkTransport.m
│ ├── NSSet+Disjoint.m
│ ├── Fragments.h
│ ├── JSONSerializationFormat.m
│ ├── NetworkTransport.h
│ ├── GraphQLResult.m
│ ├── ApolloTuple.h
│ ├── GraphQLResponse.h
│ ├── GraphQLResult.h
│ ├── RecordSet.h
│ ├── AsynchronousOperation.h
│ ├── Field.h
│ ├── GraphQLTypes.h
│ ├── GraphQLError.h
│ ├── NSDictionary+JSONEncodable.m
│ ├── Fragments.m
│ ├── JSONStandardTypeConversions.m
│ ├── GraphQLQueryWatcher.h
│ ├── FetchQueryOperation.h
│ ├── Record.h
│ ├── GraphQLOperation.h
│ ├── ApolloTuple.m
│ ├── AsynchronousOperation.m
│ ├── GraphQLOperation.m
│ ├── JSON.h
│ ├── GraphQLResultNormalizer.h
│ ├── Record.m
│ ├── NSArray+Map.m
│ ├── HTTPNetworkTransport.h
│ ├── ApolloStore.h
│ ├── JSON.m
│ ├── GraphQLError.m
│ ├── Field.m
│ ├── GraphQLQueryWatcher.m
│ ├── GraphQLResultReader.h
│ ├── ApolloClient.h
│ ├── RecordSet.m
│ ├── GraphQLResponse.m
│ ├── FetchQueryOperation.m
│ ├── HTTPNetworkTransport.m
│ ├── GraphQLResultReader.m
│ ├── GraphQLResultNormalizer.m
│ ├── ApolloStore.m
│ └── ApolloClient.m
├── AppDelegate.h
├── main.m
├── graphql-ios.pch
├── SecondViewController.m
├── API.h
├── FirstViewController.m
├── API.m
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
└── AppDelegate.m
├── .gitignore
├── graphql-ios.xcodeproj
├── xcuserdata
│ └── Travel.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── graphql-ios.xcscheme
├── project.xcworkspace
│ ├── xcuserdata
│ │ └── Travel.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── contents.xcworkspacedata
└── project.pbxproj
├── Podfile
├── README.md
├── LICENSE
└── Apollo.podspec
/FILE_LICENSE:
--------------------------------------------------------------------------------
1 | MIT
2 |
--------------------------------------------------------------------------------
/Apollo_OC/Assets.xcassets/first.imageset/first.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/funcompany/graphql-ios/HEAD/Apollo_OC/Assets.xcassets/first.imageset/first.pdf
--------------------------------------------------------------------------------
/Apollo_OC/Assets.xcassets/second.imageset/second.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/funcompany/graphql-ios/HEAD/Apollo_OC/Assets.xcassets/second.imageset/second.pdf
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Apollo_OC.xcodeproj/xcuserdata/
2 | Apollo_OC.xcworkspace/
3 | Pods/
4 | *.swp
5 | Podfile.lock
6 | .DS_Store
7 | Apollo_OC.xcodeproj/project.xcworkspace/xcuserdata/
8 | /upload.sh
9 |
--------------------------------------------------------------------------------
/graphql-ios.xcodeproj/xcuserdata/Travel.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/graphql-ios.xcodeproj/project.xcworkspace/xcuserdata/Travel.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/funcompany/graphql-ios/HEAD/graphql-ios.xcodeproj/project.xcworkspace/xcuserdata/Travel.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Apollo_OC/Assets.xcassets/first.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "first.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Apollo_OC/Assets.xcassets/second.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "second.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/graphql-ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Apollo_OC/FirstViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FirstViewController.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FirstViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Apollo_OC/SecondViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface SecondViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSMutableArray+Concat.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSMutableArray+Concat.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 demo. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSMutableArray (Concat)
12 | - (void)concat:(NSArray *)array;
13 | @end
14 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSSet+Disjoint.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSSet+Disjoint.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/17/17.
6 | // Copyright © 2017 demo. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSSet (Disjoint)
12 |
13 | - (BOOL)isDisjointWithSet:(NSSet *)other;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Cancellable.m:
--------------------------------------------------------------------------------
1 | //
2 | // Cancellable.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "Cancellable.h"
10 |
11 | @implementation Cancellable
12 |
13 | - (void)cancel {
14 | NSAssert(NO, @"Should Not Get Here");
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSHTTPURLResponse+Utilities.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSHTTPURLResponse+Utilities.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/17/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSHTTPURLResponse (Utilities)
12 |
13 | - (BOOL)isSuccessful;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Apollo_OC/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | source 'https://github.com/travel-iLabsTechTalk/Specs.git'
5 | source 'https://github.com/CocoaPods/Specs.git'
6 |
7 | target 'Apollo_OC' do
8 | # Uncomment this line if you're using Swift or would like to use dynamic frameworks
9 | # use_frameworks!
10 |
11 | end
12 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSMutableArray+Concat.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSMutableArray+Concat.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 demo. All rights reserved.
7 | //
8 |
9 | #import "NSMutableArray+Concat.h"
10 |
11 | @implementation NSMutableArray (Concat)
12 | - (void)concat:(NSArray *)array {
13 | [self addObjectsFromArray:array];
14 | }
15 | @end
16 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/CacheKeyForObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // CacheKeyForObject.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/16/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #ifndef CacheKeyForObject_h
10 | #define CacheKeyForObject_h
11 |
12 | typedef id(^CacheKeyForObject)(NSDictionary *object);
13 |
14 | #endif /* CacheKeyForObject_h */
15 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Cancellable.h:
--------------------------------------------------------------------------------
1 | //
2 | // Cancellable.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol Cancellable
12 |
13 | - (void)cancel;
14 |
15 | @end
16 |
17 | @interface Cancellable : NSObject
18 | - (void)cancel;
19 | @end
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is an objective-c port of the origins [apollo-ios](https://github.com/apollographql/apollo-ios) library.
2 |
3 | Using with cocoapods
4 | `pod 'graphql-ios', :git => 'git@github.com:funcompany/graphql-ios.git', :tag => '0.0.9'`
5 |
6 | We haven't implement a codegen for api yet, and to get the response data, use `dataEntry` property of `GraphQLResultReader`, and convert to model with your faourite lib.
7 |
--------------------------------------------------------------------------------
/Apollo_OC/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLTypes.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLTypes.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLTypes.h"
10 | #import "NSDictionary+JSONEncodable.h"
11 |
12 | @implementation GraphQLMapConvertible
13 | @dynamic jsonValue;
14 |
15 | - (id)jsonValue {
16 | return self.graphQLMap.jsonValue;
17 | }
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/JSONSerializationFormat.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSONSerializationFormat.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "JSON.h"
11 |
12 | @interface JSONSerializationFormat : NSObject
13 | - (NSData *)serialize:(id)value;
14 | - (id)deserialize:(NSData *)data;
15 | @end
16 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/JSONStandardTypeConversions.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSONStandardTypeConversions.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/19/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "JSON.h"
11 |
12 | @interface NSString (JSON)
13 | @property (nonatomic, strong) id jsonValue;
14 | - (instancetype)init:(id)value;
15 | @end
16 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSDictionary+JSONEncodable.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSDictionary+JSONEncodable.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/10/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "JSON.h"
11 |
12 | @interface NSDictionary (JSONEncodable)
13 |
14 | - (id)jsonValue;
15 | - (NSDictionary *)jsonObject;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSHTTPURLResponse+Utilities.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSHTTPURLResponse+Utilities.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/17/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "NSHTTPURLResponse+Utilities.h"
10 |
11 | @implementation NSHTTPURLResponse (Utilities)
12 |
13 | - (BOOL)isSuccessful {
14 | return (self.statusCode >= 200 && self.statusCode < 300);
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSArray+Map.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+Map.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 demo. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef id(^FUNCTION1)(id);
12 |
13 | @interface NSArray (Map)
14 | - (NSArray *)flatten;
15 | - (NSArray *)map:(id (^)(id obj, NSUInteger idx))block;
16 | - (NSArray *)flatMap:(id (^)(id obj, NSUInteger idx))block;
17 | @end
18 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/OperationResultHandler.h:
--------------------------------------------------------------------------------
1 | //
2 | // OperationResultHandler.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/17/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 | #import "GraphQLResult.h"
9 |
10 | #ifndef OperationResultHandler_h
11 | #define OperationResultHandler_h
12 |
13 | typedef void(^OperationResultHandler)(GraphQLResult *result, NSError *error);
14 |
15 | #endif /* OperationResultHandler_h */
16 |
--------------------------------------------------------------------------------
/Apollo_OC/graphql-ios.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Apollo_OC.pch
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #ifndef Apollo_OC_pch
10 | #define Apollo_OC_pch
11 |
12 | //#define JSONObject NSString *, JSONValue
13 | //#define GraphQLMap NSString *, id
14 | //#define CacheKey NSString
15 | //#define JSONValue id
16 | //#define GraphQLID NSString
17 |
18 | #import "YYModel.h"
19 |
20 | #endif /* Apollo_OC_pch */
21 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NetworkTransport.m:
--------------------------------------------------------------------------------
1 | //
2 | // NetworkTransport.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "NetworkTransport.h"
10 |
11 | @implementation NetworkTransport
12 |
13 | - (id)send:(GraphQLOperation *)operation completionHandler:(void(^)(GraphQLResponse *response, NSError *error))completionHandler {
14 | NSAssert(NO, @"Should not get here");
15 | return nil;
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSSet+Disjoint.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSSet+Disjoint.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/17/17.
6 | // Copyright © 2017 demo. All rights reserved.
7 | //
8 |
9 | #import "NSSet+Disjoint.h"
10 |
11 | @implementation NSSet (Disjoint)
12 |
13 | - (BOOL)isDisjointWithSet:(NSSet *)other {
14 | BOOL isDisjoint = NO;
15 | for (id object in other) {
16 | if ([self containsObject:object]) {
17 | isDisjoint = YES;
18 | break;
19 | }
20 | }
21 | return isDisjoint;
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Fragments.h:
--------------------------------------------------------------------------------
1 | //
2 | // Fragments.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GraphQLTypes.h"
11 |
12 | @interface GraphQLConditionalFragment : NSObject
13 | @property (nonatomic, strong) NSMutableArray *possibleTypes;
14 | @end
15 |
16 | @interface GraphQLNamedFragment : GraphQLConditionalFragment
17 | @property (nonatomic, strong) NSString *fragmentDefinition;
18 | @end
19 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/JSONSerializationFormat.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSONSerializationFormat.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "JSONSerializationFormat.h"
10 |
11 | @implementation JSONSerializationFormat
12 |
13 | - (NSData *)serialize:(id)value {
14 | return [NSJSONSerialization dataWithJSONObject:value options:0 error:nil];
15 | }
16 |
17 | - (id)deserialize:(NSData *)data {
18 | return [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
19 | }
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NetworkTransport.h:
--------------------------------------------------------------------------------
1 | //
2 | // NetworkTransport.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GraphQLResponse.h"
11 | #import "Cancellable.h"
12 |
13 | @protocol NetworkTransport
14 |
15 | - (id)send:(GraphQLOperation *)operation completionHandler:(void(^)(GraphQLResponse *response, NSError *error))completionHandler;
16 |
17 | @end
18 |
19 | @interface NetworkTransport : NSObject
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResult.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResult.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLResult.h"
10 |
11 | @implementation GraphQLResult
12 |
13 | - (instancetype)initWithData:(id)data errors:(NSArray *)errors dependentKeys:(NSSet *)dependentKeys {
14 | self = [super init];
15 | if (self) {
16 | self.data = data;
17 | self.errors = errors;
18 | self.dependentKeys = dependentKeys;
19 | }
20 | return self;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/graphql-ios.xcodeproj/xcuserdata/Travel.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | graphql-ios.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | ED8709661EA610A200CB9BC6
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Apollo_OC/SecondViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "SecondViewController.h"
10 |
11 | @interface SecondViewController ()
12 |
13 | @end
14 |
15 | @implementation SecondViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 | }
21 |
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/ApolloTuple.h:
--------------------------------------------------------------------------------
1 | //
2 | // ApolloTuple.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/17/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ApolloTuple : NSObject
12 |
13 | @property (nonatomic, strong) id first;
14 | @property (nonatomic, strong) id second;
15 | @property (nonatomic, strong) id third;
16 | @property (nonatomic, strong) id fouth;
17 |
18 | + (instancetype)withFirst:(id)first second:(id)second;
19 | + (instancetype)withFirst:(id)first second:(id)second third:(id)third;
20 | + (instancetype)withFirst:(id)first second:(id)second third:(id)third fouth:(id)fouth;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResponse.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResponse.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GraphQLOperation.h"
11 | #import "CacheKeyForObject.h"
12 | #import "ApolloTuple.h"
13 |
14 | @interface GraphQLResponse : GraphQLOperation
15 | @property (nonatomic, strong) GraphQLOperation *operation;
16 | @property (nonatomic, strong) NSDictionary *body;
17 |
18 | - (instancetype)initWithOperation:(GraphQLOperation *)operation body:(NSDictionary *)body;
19 | - (ApolloTuple *)parseResult:(CacheKeyForObject)cacheKeyForObject;
20 | @end
21 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResult.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResult.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GraphQLError.h"
11 | #import "GraphQLTypes.h"
12 |
13 | @interface GraphQLResult : NSObject
14 |
15 | @property (nonatomic, strong) id data;
16 | @property (nonatomic, strong) NSArray *errors;
17 | @property (nonatomic, strong) NSSet *dependentKeys;
18 |
19 | - (instancetype)initWithData:(id)data errors:(NSArray *)errors dependentKeys:(NSSet *)dependentKeys;
20 |
21 | @end
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/RecordSet.h:
--------------------------------------------------------------------------------
1 | //
2 | // RecordSet.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "Record.h"
11 |
12 | @interface RecordSet : NSObject
13 | @property (nonatomic, strong) NSMutableDictionary *storage;
14 | - (instancetype)init:(NSArray *)records;
15 | - (BOOL)isEmpty;
16 | - (void)insert:(Record *)record;
17 | - (void)insertContentsOf:(NSArray *)records;
18 | - (Record *)recordForKey:(NSString *)key;
19 | - (NSSet *)mergeRecords:(RecordSet *)records;
20 | - (NSSet *)mergeRecord:(Record *)record;
21 | @end
22 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/AsynchronousOperation.h:
--------------------------------------------------------------------------------
1 | //
2 | // AsynchronousOperation.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, State) {
12 | StateInitialized,
13 | StateReady,
14 | StateExecuting,
15 | StateFinished
16 | };
17 |
18 | @interface AsynchronousOperation : NSOperation
19 |
20 | @property (nonatomic) State state;
21 |
22 | + (NSSet *)keyPathsForValuesAffectingIsExecuting;
23 | + (NSSet *)keyPathsForValuesAffectingIsFinished;
24 | - (BOOL)isAsynchronous;
25 | - (BOOL)isReady;
26 | - (BOOL)isExecuting;
27 | - (BOOL)isFinished;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Field.h:
--------------------------------------------------------------------------------
1 | //
2 | // Field.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "JSON.h"
11 |
12 | @interface Field : NSObject
13 | @property (nonatomic, strong) NSString *responseName;
14 | @property (nonatomic, strong) NSString *fieldName;
15 | @property (nonatomic, strong) NSDictionary > *arguments;
16 | @property (nonatomic, strong) NSString *cacheKey;
17 |
18 | - (instancetype)initWithResponseName:(NSString *)responseName fieldName:(NSString *)fieldName arguments:(NSDictionary >*)arguments;
19 | - (NSString *)orderIndependentKeyForObject:(NSDictionary *)object;
20 | @end
21 |
--------------------------------------------------------------------------------
/Apollo_OC/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/Apollo_OC/API.h:
--------------------------------------------------------------------------------
1 | #import "GraphQLOperation.h"
2 | #import "GraphQLTypes.h"
3 |
4 | @interface StarshipQuery : GraphQLQuery
5 | - (nonnull instancetype)initWith;
6 | - (nonnull Class)responseDataClass;
7 | @end
8 |
9 | @interface StarshipDataStarship : NSObject
10 |
11 | @property (nonatomic, copy, nonnull, readonly) NSString *name;
12 | @property (nonatomic, copy, nonnull, readonly) NSArray *> *coordinates;
13 |
14 | - (nonnull instancetype)initWithReader:(GraphQLResultReader *_Nullable)reader;
15 | @end
16 |
17 | @interface StarshipData : NSObject
18 |
19 | @property (nonatomic, strong, nullable, readonly) StarshipDataStarship *starship;
20 |
21 | - (nonnull instancetype)initWithReader:(GraphQLResultReader *_Nullable)reader;
22 | @end
23 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLTypes.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLTypes.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GraphQLResultReader.h"
11 |
12 | @protocol GraphQLMappable
13 |
14 | - (instancetype)initWithReader:(GraphQLResultReader *)reader;
15 |
16 | @end
17 |
18 | @protocol GraphQLMapConvertible
19 |
20 | @property (nonatomic, strong) NSMutableDictionary > *graphQLMap;
21 |
22 | @end
23 |
24 | @interface GraphQLMapConvertible : NSObject
25 |
26 | @property (nonatomic, strong) NSMutableDictionary > *graphQLMap;
27 |
28 | - (id)jsonValue;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLError.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLError.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Location : NSObject
12 | @property (nonatomic) NSInteger line;
13 | @property (nonatomic) NSInteger column;
14 | - (instancetype)initWithObject:(NSDictionary *)object;
15 | @end
16 |
17 |
18 | @interface GraphQLError : NSError
19 |
20 | - (instancetype)initWithObject:(NSDictionary *)object;
21 | - (instancetype)initWithMessage:(NSString *)message;
22 | - (id)infoForKey:(NSString *)key;
23 | - (NSString *)message;
24 | - (NSArray *)locations;
25 | - (NSString *)description;
26 | - (NSString *)errorDescription;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSDictionary+JSONEncodable.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSDictionary+JSONEncodable.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/10/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "NSDictionary+JSONEncodable.h"
10 |
11 | @implementation NSDictionary (JSONEncodable)
12 | @dynamic jsonValue;
13 |
14 | - (id)jsonValue {
15 | return self.jsonObject;
16 | }
17 |
18 | - (NSDictionary *)jsonObject {
19 | NSMutableDictionary *jsonObject = [NSMutableDictionary dictionary];
20 | for (NSString *key in self.allKeys) {
21 | id value = self[key];
22 | if (value && [value conformsToProtocol:@protocol(JSONEncodable)]) {
23 | jsonObject[key] = [(id)value jsonValue];
24 | }
25 | }
26 | return jsonObject;
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Fragments.m:
--------------------------------------------------------------------------------
1 | //
2 | // Fragments.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "Fragments.h"
10 |
11 | @implementation GraphQLConditionalFragment
12 |
13 | - (instancetype)init {
14 | self = [super init];
15 | if (self && !self.possibleTypes) {
16 | self.possibleTypes = [NSMutableArray array];
17 | }
18 | return self;
19 | }
20 |
21 | - (instancetype)initWithReader:(GraphQLResultReader *)reader {
22 | self = [self init];
23 | return self;
24 | }
25 |
26 | - (instancetype)initWithReader:(GraphQLResultReader *)reader ifTypeMatches:(NSString *)typeName {
27 | if (![self.possibleTypes containsObject:typeName]) {
28 | return nil;
29 | }
30 | self = [self initWithReader:reader];
31 | return self;
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/JSONStandardTypeConversions.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSONStandardTypeConversions.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/19/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "JSONStandardTypeConversions.h"
10 |
11 | @implementation NSString (JSON)
12 | @dynamic jsonValue;
13 | #pragma clang diagnostic push
14 | #pragma clang diagnostic ignored "-Wobjc-designated-initializers"
15 | - (instancetype)init:(id)value {
16 | if (![value isKindOfClass:[NSString class]]) {
17 | NSString *info = [NSString stringWithFormat:@"JSONDecodingError.couldNotConvert(value: %@, to: %@)", value, NSStringFromClass([NSString class])];
18 | @throw [NSException exceptionWithName:info reason:info userInfo:nil];
19 | }
20 | self = value;
21 | return self;
22 | }
23 |
24 | - (id)jsonValue {
25 | return self;
26 | }
27 | #pragma clang diagnostic pop
28 | @end
29 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLQueryWatcher.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLQueryWatcher.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "ApolloClient.h"
10 |
11 | @interface GraphQLQueryWatcher : ApolloStoreSubscriber
12 |
13 | @property (nonatomic, weak) ApolloClient *client;
14 | @property (nonatomic, strong) GraphQLQuery *query;
15 | @property (nonatomic) dispatch_queue_t handlerQueue;
16 | @property (nonatomic) OperationResultHandler resultHandler;
17 |
18 | @property (nonatomic) NSInteger context;
19 | @property (nonatomic, weak) idfetching;
20 | @property (nonatomic, strong) NSMutableSet *dependentKeys;
21 |
22 | - (instancetype)initWithClient:(ApolloClient *)client query:(GraphQLQuery *)query handlerQueue:(dispatch_queue_t)handlerQueue resultHandler:(OperationResultHandler)resultHandler;
23 | - (void)refetch;
24 | - (void)fetch:(CachePolicy)cachePolicy;
25 | - (void)cancel;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/FetchQueryOperation.h:
--------------------------------------------------------------------------------
1 | //
2 | // FetchQueryOperation.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "AsynchronousOperation.h"
10 | #import "ApolloClient.h"
11 |
12 | @interface FetchQueryOperation : AsynchronousOperation
13 |
14 | @property (nonatomic, strong) ApolloClient *client;
15 | @property (nonatomic, strong) GraphQLQuery *query;
16 | @property (nonatomic,) CachePolicy cachePolicy;
17 | @property (nonatomic) NSInteger context;
18 | @property (nonatomic) dispatch_queue_t handlerQueue;
19 | @property (nonatomic) OperationResultHandler resultHandler;
20 | @property (nonatomic, strong) idnetworkTask;
21 |
22 | - (instancetype)initWithClient:(ApolloClient *)client query:(GraphQLQuery *)query cachePolicy:(CachePolicy)cachePolicy context:(NSInteger)context handlerQueue:(dispatch_queue_t)handlerQueue resultHandler:(OperationResultHandler)resultHandler;
23 | - (void)cancel;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Record.h:
--------------------------------------------------------------------------------
1 | //
2 | // Record.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/7/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Record : NSObject
12 |
13 | @property (nonatomic, strong) NSString * _Nonnull key;
14 | @property (nonatomic, strong) NSMutableDictionary * _Nonnull fields;
15 |
16 | - (instancetype _Nonnull)initWithKey:(NSString * _Nonnull)key fields:(NSMutableDictionary *_Nullable)fields;
17 | - (id _Nonnull)valueForKey:(NSString * _Nonnull)key;
18 | - (void)setRecordValue:(id _Nonnull)value forKey:(NSString * _Nonnull)key;
19 |
20 | - (NSString * _Nonnull)description;
21 |
22 | @end
23 |
24 |
25 | @interface Reference : NSObject
26 |
27 | @property (nonatomic, strong) NSString * _Nonnull key;
28 |
29 | - (instancetype _Nonnull)initWithKey:(NSString * _Nonnull)key;
30 | - (BOOL)isEqual:(Reference *_Nonnull)object;
31 | - (NSString * _Nonnull)description;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLOperation.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLOperation.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "JSON.h"
11 | #import "GraphQLResultReader.h"
12 | #import "GraphQLTypes.h"
13 |
14 | @interface GraphQLOperation : NSObject
15 | @property (nonatomic, strong) NSString *operationDefinition;
16 | @property (nonatomic, strong) NSString *queryDocument;
17 | @property (nonatomic, strong) NSMutableDictionary > *variables;
18 |
19 | - (NSString *)queryDocument;
20 | - (instancetype)initWithReader:(GraphQLResultReader *)reader;
21 | - (Class)responseDataClass;
22 | @end
23 |
24 | @interface GraphQLQuery : GraphQLOperation
25 |
26 | @end
27 |
28 | @interface GraphQLMutation : GraphQLOperation
29 |
30 | @end
31 |
32 | //@interface GraphQLFragment : GraphQLOperation
33 | //@property (nonatomic, strong) NSArray *possibleTypes;
34 | //@end
35 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/ApolloTuple.m:
--------------------------------------------------------------------------------
1 | //
2 | // ApolloTuple.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/17/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "ApolloTuple.h"
10 |
11 | @implementation ApolloTuple
12 |
13 | - (instancetype)initWithFirst:(id)first second:(id)second third:(id)third fouth:(id)fouth {
14 | self = [super init];
15 | if (self) {
16 | self.first = first;
17 | self.second = second;
18 | self.third = third;
19 | self.fouth = fouth;
20 | }
21 | return self;
22 | }
23 |
24 | + (instancetype)withFirst:(id)first second:(id)second {
25 | return [[self alloc] initWithFirst:first second:second third:nil fouth:nil];
26 | }
27 |
28 | + (instancetype)withFirst:(id)first second:(id)second third:(id)third {
29 | return [[self alloc] initWithFirst:first second:second third:third fouth:nil];
30 | }
31 |
32 | + (instancetype)withFirst:(id)first second:(id)second third:(id)third fouth:(id)fouth {
33 | return [[self alloc] initWithFirst:first second:second third:third fouth:fouth];
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Apollo_OC/FirstViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // FirstViewController.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "FirstViewController.h"
10 | #import "API.h"
11 | #import "ApolloClient.h"
12 |
13 | @interface FirstViewController ()
14 |
15 | @end
16 |
17 | @implementation FirstViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | // Do any additional setup after loading the view, typically from a nib.
22 | }
23 |
24 |
25 | - (void)didReceiveMemoryWarning {
26 | [super didReceiveMemoryWarning];
27 | // Dispose of any resources that can be recreated.
28 | }
29 |
30 | - (void)viewDidAppear:(BOOL)animated {
31 | [super viewDidAppear:animated];
32 | ApolloClient *client = [[ApolloClient alloc] initWithUrl:[NSURL URLWithString:@"http://10.0.1.58:8080/graphql"]];
33 | [client watch:[[StarshipQuery alloc] init] resultHandler:^(GraphQLResult *result, NSError *error) {
34 |
35 | }];
36 |
37 | NSArray *arr = @[@1,@2,@3,@4,@5];
38 | NSLog(@"%@", [arr subarrayWithRange:NSMakeRange(3, 2)]);
39 | }
40 |
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/AsynchronousOperation.m:
--------------------------------------------------------------------------------
1 | //
2 | // AsynchronousOperation.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "AsynchronousOperation.h"
10 | #import
11 |
12 | @implementation AsynchronousOperation
13 |
14 | + (NSSet *)keyPathsForValuesAffectingIsExecuting {
15 | return [NSSet setWithObject:@"state"];
16 | }
17 |
18 | + (NSSet *)keyPathsForValuesAffectingIsFinished {
19 | return [NSSet setWithObject:@"state"];
20 | }
21 |
22 | - (void)setState:(State)state {
23 | if (_state != state) {
24 | [self willChangeValueForKey:@"state"];
25 | _state = state;
26 | [self didChangeValueForKey:@"state"];
27 | }
28 | }
29 |
30 | - (BOOL)isAsynchronous {
31 | return YES;
32 | }
33 |
34 | - (BOOL)isReady {
35 | BOOL ready = [super isReady];
36 | if (ready) {
37 | self.state = StateReady;
38 | }
39 | return YES;
40 | }
41 |
42 | - (BOOL)isExecuting {
43 | return self.state == StateExecuting;
44 | }
45 |
46 | - (BOOL)isFinished {
47 | return self.state == StateFinished;
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLOperation.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLOperation.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLOperation.h"
10 |
11 | @implementation GraphQLOperation
12 |
13 | - (instancetype)init {
14 | self = [super init];
15 | if (self) {
16 | self.variables = [NSMutableDictionary dictionary];
17 | }
18 | return self;
19 | }
20 |
21 | - (NSString *)queryDocument {
22 | return self.operationDefinition;
23 | }
24 |
25 | - (instancetype)initWithReader:(GraphQLResultReader *)reader {
26 | self = [self init];
27 | NSAssert(NO, @"Should not get here, sub class should overwrite this method");
28 | return self;
29 | }
30 |
31 | - (Class)responseDataClass {
32 | return [self class];
33 | }
34 |
35 | @end
36 |
37 |
38 | @implementation GraphQLQuery
39 |
40 | @end
41 |
42 | @implementation GraphQLMutation
43 |
44 | @end
45 |
46 | //@implementation GraphQLFragment
47 | //
48 | //- (instancetype)init {
49 | // self = [super init];
50 | // if (self) {
51 | // self.possibleTypes = [NSMutableArray array];
52 | // }
53 | // return self;
54 | //}
55 | //
56 | //@end
57 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/JSON.h:
--------------------------------------------------------------------------------
1 | //
2 | // GQJSON.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/7/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, JSONDecodingError) {
12 | JSONDecodingErrorMissingValue,
13 | JSONDecodingErrorNullValue,
14 | JSONDecodingErrorWrongType,
15 | JSONDecodingErrorCounldNotConvert
16 | };
17 |
18 | #pragma mark - JSONDecodable
19 |
20 | @protocol JSONDecodable
21 |
22 | - (instancetype)init:(id)value;
23 |
24 | @end
25 |
26 | @interface JSONDecodable : NSObject
27 |
28 | - (instancetype)init:(id)value;
29 |
30 | @end
31 |
32 | #pragma mark - JSONEncodable
33 |
34 | @protocol JSONEncodable
35 |
36 | @property (nonatomic, strong) id jsonValue;
37 |
38 | @end
39 |
40 | @interface JSONEncodable : NSObject
41 |
42 | @property (nonatomic, strong) id jsonValue;
43 |
44 | @end
45 |
46 | #pragma mark - JSON
47 |
48 | @interface JSON : NSObject
49 |
50 | - (id)optional:(id)optionalValue;
51 | - (id)required:(id)optionalValue;
52 | - (id)cast:(id)value toKind:(Class)clazz;
53 | - (BOOL)equals:(id)lhs rhs:(id)rhs;
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResultNormalizer.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResultNormalizer.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "RecordSet.h"
10 | #import "CacheKeyForObject.h"
11 | #import "GraphQLResultReader.h"
12 |
13 | @class Field;
14 | @class GraphQLResolveInfo;
15 | @interface GraphQLResultNormalizer : NSObject
16 | @property (nonatomic, strong) RecordSet *records;
17 | @property (nonatomic, strong) NSMutableSet *dependentKeys;
18 | @property (nonatomic, strong) CacheKeyForObject cacheKeyForObject;
19 |
20 | - (instancetype)initWithRootKey:(NSString *)rootKey;
21 |
22 | //- (void)willResolve:(Field *)field info:(GraphQLResolveInfo *)info;
23 | //- (void)didResolve:(Field *)field info:(GraphQLResolveInfo *)info;
24 | //- (void)didParse:(id)value;
25 | //- (void)didParseNull;
26 | //- (void)willParse:(NSDictionary *)object;
27 | //- (void)didParseJSONObject:(NSDictionary *)object;
28 | //- (void)willParseElements:(NSArray *)array;
29 | //- (void)willParseElementAtIndex:(NSInteger)index;
30 | //- (void)didParseElementAtIndex:(NSInteger)index;
31 | //- (void)didParseElements:(NSArray *)array;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Record.m:
--------------------------------------------------------------------------------
1 | //
2 | // Record.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/7/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "Record.h"
10 |
11 | @implementation Record
12 |
13 | - (instancetype)initWithKey:(NSString *)key fields:(NSMutableDictionary *)fields {
14 | self = [super init];
15 | if (self) {
16 | self.key = key;
17 | self.fields = fields ?: [NSMutableDictionary dictionary];
18 | }
19 | return self;
20 | }
21 |
22 | - (id)valueForKey:(NSString *)key {
23 | return self.fields[key];
24 | }
25 |
26 | - (void)setRecordValue:(id)value forKey:(NSString *)key{
27 | self.fields[key] = value;
28 | }
29 |
30 | - (NSString *)description {
31 | return [NSString stringWithFormat:@"#%@ -> %@", self.key, self.fields];
32 | }
33 |
34 | @end
35 |
36 | @implementation Reference
37 |
38 | - (instancetype _Nonnull)initWithKey:(NSString * _Nonnull)key {
39 | self = [super init];
40 | if (self) {
41 | self.key = key;
42 | }
43 | return self;
44 | }
45 |
46 | - (BOOL)isEqual:(Reference *_Nonnull)object {
47 | return [object.key isEqualToString:self.key];
48 | }
49 |
50 | - (NSString * _Nonnull)description {
51 | return [NSString stringWithFormat:@"-> #%@", self.key];
52 | }
53 |
54 | @end
55 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/NSArray+Map.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+Map.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 demo. All rights reserved.
7 | //
8 |
9 | #import "NSArray+Map.h"
10 | #import "NSMutableArray+Concat.h"
11 |
12 | @implementation NSArray (Map)
13 |
14 | - (NSArray *)map:(id (^)(id obj, NSUInteger idx))block {
15 | NSMutableArray *result = [NSMutableArray arrayWithCapacity:[self count]];
16 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
17 | [result addObject:block(obj, idx) ?: [NSNull null]];
18 | }];
19 | return result;
20 | }
21 |
22 | - (NSArray *)flatMap:(id (^)(id obj, NSUInteger idx))block {
23 | NSArray *flattenArray = [self flatten];
24 | NSMutableArray *result = [NSMutableArray arrayWithCapacity:[flattenArray count]];
25 | [flattenArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
26 | [result addObject:block(obj, idx) ?: [NSNull null]];
27 | }];
28 | return result;
29 | }
30 |
31 | - (NSArray *)flatten {
32 | NSMutableArray *array = [NSMutableArray array];
33 |
34 | for (id object in self) {
35 | if ([object isKindOfClass:NSArray.class]) {
36 | [array concat:[object flatten]];
37 | } else {
38 | [array addObject:object];
39 | }
40 | }
41 |
42 | return array;
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Apollo_OC/API.m:
--------------------------------------------------------------------------------
1 | // This file was automatically generated and should not be edited.
2 | #import "API.h"
3 |
4 | @implementation StarshipQuery
5 | - (NSString *)operationDefinition {
6 | return [NSString stringWithFormat:
7 | @"query Starship {"
8 | " starship(id: 3000) {"
9 | " name"
10 | " coordinates"
11 | " }"
12 | "}"
13 | ];
14 | }
15 | - (nonnull Class)responseDataClass {
16 | return NSClassFromString(@"StarshipData");
17 | }
18 | - (nonnull instancetype)initWith; {
19 | if (self = [super init]) {
20 | }
21 | return self;
22 | }
23 | @end
24 |
25 | @interface StarshipDataStarship ()
26 | @end
27 |
28 | @implementation StarshipDataStarship
29 |
30 |
31 | - (nonnull instancetype)initWithReader:(GraphQLResultReader *_Nullable)reader {
32 | if (self = [super init]) { {
33 | _name = [reader valueForField:[[Field alloc] initWithResponseName:@"name" fieldName:nil arguments:nil]];
34 | _coordinates = [reader listForField:[[Field alloc] initWithResponseName:@"coordinates" fieldName:nil arguments:nil]];
35 | }
36 | }
37 | return self;
38 | }
39 | @end
40 |
41 | @interface StarshipData ()
42 | @end
43 |
44 | @implementation StarshipData
45 |
46 |
47 | - (nonnull instancetype)initWithReader:(GraphQLResultReader *_Nullable)reader {
48 | if (self = [super init]) {
49 | NSDictionary *data = [reader valueForField:[[Field alloc] initWithResponseName:@"starship" fieldName:nil arguments:nil]];
50 | NSLog(@"1111111%@",data);
51 | }
52 | return self;
53 | }
54 | @end
55 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/HTTPNetworkTransport.h:
--------------------------------------------------------------------------------
1 | //
2 | // HTTPNetworkTransport.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "NetworkTransport.h"
10 | #import "JSONSerializationFormat.h"
11 |
12 | @interface HTTPNetworkTransport : NetworkTransport
13 |
14 | @property (nonatomic, strong) NSURL *url;
15 | @property (nonatomic, strong) NSURLSession *session;
16 | @property (nonatomic, strong) JSONSerializationFormat *serializationFormat;
17 |
18 |
19 | /// Creates a network transport with the specified server URL and session configuration.
20 | ///
21 | /// - Parameters:
22 | /// - url: The URL of a GraphQL server to connect to.
23 | /// - configuration: A session configuration used to configure the session. Defaults to `URLSessionConfiguration.default`.
24 | - (instancetype)initWithUrl:(NSURL *)url configuration:(NSURLSessionConfiguration *)configuration;
25 |
26 | /// Send a GraphQL operation to a server and return a response.
27 | ///
28 | /// - Parameters:
29 | /// - operation: The operation to send.
30 | /// - completionHandler: A closure to call when a request completes.
31 | /// - response: The response received from the server, or `nil` if an error occurred.
32 | /// - error: An error that indicates why a request failed, or `nil` if the request was succesful.
33 | /// - Returns: An object that can be used to cancel an in progress request.
34 | - (id)send:(GraphQLOperation *)operation completionHandler:(void(^)(GraphQLResponse *response, NSError *error))completionHandlerl;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/ApolloStore.h:
--------------------------------------------------------------------------------
1 | //
2 | // ApolloStore.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "RecordSet.h"
11 | #import "Record.h"
12 | #import "GraphQLOperation.h"
13 | #import "CacheKeyForObject.h"
14 | #import "OperationResultHandler.h"
15 |
16 | @class ApolloStoreSubscriber;
17 | @class ReadWriteTransaction;
18 | @interface ApolloStore : NSObject
19 | @property (nonatomic) dispatch_queue_t queue;
20 | @property (nonatomic, strong) RecordSet *records;
21 | @property (nonatomic, strong) NSMutableArray *subscribers;
22 | //@property (nonatomic) CacheKeyForObject cacheKeyForObject;
23 | //@property (nonatomic, strong) NormalizedCache *cache;
24 |
25 |
26 | // We need a separate read/write lock for cache access because cache operations are
27 | // asynchronous and we don't want to block the dispatch threads
28 | //@property (nonatomic, strong) ReadWriteLock *cacheLock;
29 |
30 | + (NSString *)rootKeyForOperation:(GraphQLOperation *)operation;
31 |
32 | - (void)publish:(RecordSet *)records context:(NSInteger)context;
33 |
34 | - (void)subscribe:(ApolloStoreSubscriber *)subscriber;
35 |
36 | - (void)unsubscribe:(ApolloStoreSubscriber *)subscriber;
37 |
38 | - (void)loadQuery:(GraphQLQuery *)query cacheKeyForObject:(CacheKeyForObject)cacheKeyForObject resultHandler:(OperationResultHandler)resultHandler;
39 |
40 | @end
41 |
42 | @interface ApolloStoreSubscriber : NSObject
43 | - (void)store:(ApolloStore *)store didChangeKeys:(NSSet *)changedKeys context:(NSInteger)context;
44 | @end
45 |
--------------------------------------------------------------------------------
/Apollo_OC/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | NSAppTransportSecurity
24 |
25 | NSAllowsArbitraryLoads
26 |
27 |
28 | UILaunchStoryboardName
29 | LaunchScreen
30 | UIMainStoryboardFile
31 | Main
32 | UIRequiredDeviceCapabilities
33 |
34 | armv7
35 |
36 | UIStatusBarTintParameters
37 |
38 | UINavigationBar
39 |
40 | Style
41 | UIBarStyleDefault
42 | Translucent
43 |
44 |
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/JSON.m:
--------------------------------------------------------------------------------
1 | //
2 | // GQJSON.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/7/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "JSON.h"
10 | #import "Record.h"
11 |
12 | @implementation JSON
13 |
14 | - (id)optional:(id)optionalValue {
15 | if (!optionalValue) {
16 | @throw [NSException exceptionWithName:@"JSONDecodingError.missingValue" reason:@"JSONDecodingError.missingValue" userInfo:nil];
17 | }
18 |
19 | if ([optionalValue isKindOfClass:[NSNull class]]) {
20 | return nil;
21 | }
22 |
23 | return optionalValue;
24 | }
25 |
26 | - (id)required:(id)optionalValue {
27 | if (!optionalValue) {
28 | @throw [NSException exceptionWithName:@"JSONDecodingError.missingValue" reason:@"JSONDecodingError.missingValue" userInfo:nil];
29 | }
30 |
31 | if ([optionalValue isKindOfClass:[NSNull class]]) {
32 | @throw [NSException exceptionWithName:@"JSONDecodingError.nullValue" reason:@"JSONDecodingError.nullValue" userInfo:nil];
33 | }
34 |
35 | return optionalValue;
36 | }
37 |
38 | - (id)cast:(id)value toKind:(Class)clazz {
39 | if (![value isKindOfClass:clazz]) {
40 | NSString *info = [NSString stringWithFormat:@"JSONDecodingError.couldNotConvert(value: %@, to: %@)", value, NSStringFromClass(clazz)];
41 | @throw [NSException exceptionWithName:info reason:info userInfo:nil];
42 | }
43 | return value;
44 | }
45 |
46 | - (BOOL)equals:(id)lhs rhs:(id)rhs {
47 | return [lhs isEqual:rhs];
48 | }
49 |
50 | @end
51 |
52 | @implementation JSONDecodable
53 |
54 | - (instancetype)init:(id)value {
55 | self = [super init];
56 | NSAssert(NO, @"");
57 | return self;
58 | }
59 |
60 | @end
61 |
62 |
63 | @implementation JSONEncodable
64 |
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLError.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLError.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLError.h"
10 |
11 | static NSString *const MessageKey = @"message";
12 | static NSString *const LocationsKey = @"locations";
13 |
14 | @implementation Location
15 |
16 | - (instancetype)initWithObject:(NSDictionary *)object {
17 | self = [super init];
18 | if (self) {
19 | self.line = [(id)object[@"line"] integerValue];
20 | self.column = [(id)object[@"column"] integerValue];
21 | }
22 | return self;
23 | }
24 |
25 | @end
26 |
27 |
28 | @interface GraphQLError ()
29 | @property (nonatomic, strong) NSDictionary *object;
30 | @end
31 |
32 | @implementation GraphQLError
33 |
34 | - (instancetype)initWithObject:(NSDictionary *)object {
35 | self = [super init];
36 | if (self) {
37 | self.object = object;
38 | }
39 | return self;
40 | }
41 |
42 | - (instancetype)initWithMessage:(NSString *)message {
43 | return [self initWithObject:@{MessageKey : message}];
44 | }
45 |
46 | - (id)infoForKey:(NSString *)key{
47 | return self.object[key];
48 | }
49 |
50 | - (NSString *)message {
51 | return (NSString *)self.object[MessageKey];
52 | }
53 |
54 | - (NSArray *)locations {
55 | NSMutableArray *tmpArray = [NSMutableArray array];
56 | for (NSDictionary *obj in (NSDictionary *)self.object[LocationsKey]) {
57 | [tmpArray addObject:[[Location alloc] initWithObject:obj]];
58 | }
59 | return tmpArray;
60 | }
61 |
62 | - (NSString *)description {
63 | return self.message;
64 | }
65 |
66 | - (NSString *)errorDescription {
67 | return [self description];
68 | }
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/Field.m:
--------------------------------------------------------------------------------
1 | //
2 | // Field.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "Field.h"
10 | #import "NSDictionary+JSONEncodable.h"
11 |
12 | @implementation Field
13 |
14 | - (instancetype)initWithResponseName:(NSString *)responseName fieldName:(NSString *)fieldName arguments:(NSDictionary >*)arguments {
15 | self = [super init];
16 | if (self) {
17 | self.responseName = responseName;
18 | self.fieldName = fieldName ?: responseName;
19 | self.arguments = arguments;
20 | NSDictionary *aArguments = self.arguments ? self.arguments.jsonObject : nil;
21 | if (aArguments && aArguments.allKeys.count > 0) {
22 | NSString *argumentsKey = [self orderIndependentKeyForObject:aArguments];
23 | self.cacheKey = [NSString stringWithFormat:@"%@(%@)", self.fieldName, argumentsKey];
24 | } else {
25 | self.cacheKey = self.fieldName;
26 | }
27 | }
28 | return self;
29 | }
30 |
31 | - (NSString *)orderIndependentKeyForObject:(NSDictionary *)object {
32 | NSArray *sortedKeys = [object keysSortedByValueUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
33 | return [obj1 compare:obj2];
34 | }];
35 | NSMutableArray *tmpArray = [NSMutableArray array];
36 | for (NSString *key in sortedKeys) {
37 | id value = object[key];
38 | NSString *str = @"";
39 | if ([value isKindOfClass:[NSDictionary class]]) {
40 | str = [NSString stringWithFormat:@"%@:%@", key, [self orderIndependentKeyForObject:value]];
41 | } else {
42 | str = [NSString stringWithFormat:@"%@:%@", key, value];
43 | }
44 | [tmpArray addObject:str];
45 | }
46 | return [tmpArray componentsJoinedByString:@","];
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Apollo_OC/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLQueryWatcher.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLQueryWatcher.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLQueryWatcher.h"
10 | #import "NSSet+Disjoint.h"
11 |
12 | @implementation GraphQLQueryWatcher
13 |
14 | - (instancetype)initWithClient:(ApolloClient *)client query:(GraphQLQuery *)query handlerQueue:(dispatch_queue_t)handlerQueue resultHandler:(OperationResultHandler)resultHandler {
15 | self = [super init];
16 | if (self) {
17 | self.client = client;
18 | self.query = query;
19 | self.handlerQueue = handlerQueue;
20 | self.resultHandler = resultHandler;
21 | self.context = 0;
22 | self.dependentKeys = [NSMutableSet set];
23 | }
24 | return self;
25 | }
26 |
27 | - (void)refetch {
28 | [self fetch:CachePolicyFetchIgnoringCacheData];
29 | }
30 |
31 | - (void)fetch:(CachePolicy)cachePolicy {
32 | if (self.client) {
33 | self.fetching = [self.client _fetch:self.query cachePolicy:cachePolicy context:self.context queue:self.handlerQueue resultHandler:^(GraphQLResult *result, NSError *error) {
34 | if (result) {
35 | self.dependentKeys = result.dependentKeys.mutableCopy;
36 | }
37 | self.resultHandler(result, error);
38 | }];
39 | }
40 | }
41 |
42 | - (void)cancel {
43 | if (self.fetching) {
44 | [self.fetching cancel];
45 | }
46 | if (self.client) {
47 | [self.client.store unsubscribe:self];
48 | }
49 | }
50 |
51 | - (void)store:(ApolloStore *)store didChangeKeys:(NSSet *)changedKeys context:(NSInteger)context {
52 | if (context == self.context) {
53 | return;
54 | }
55 | if (!self.dependentKeys) {
56 | return;
57 | }
58 | if (![self.dependentKeys isDisjointWithSet:changedKeys]) {
59 | [self fetch:CachePolicyReturnCacheDataElseFetch];
60 | }
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResultReader.h:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResultReader.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "Field.h"
11 |
12 | @interface GraphQLResolveInfo : NSObject
13 | @property (nonatomic, strong) NSMutableArray *path;
14 | @end
15 |
16 | typedef id (^GraphQLResolver)(Field *field, NSDictionary *object, GraphQLResolveInfo *info);
17 |
18 | @protocol GraphQLResultReaderDelegate
19 |
20 | - (void)willResolve:(Field *)field info:(GraphQLResolveInfo *)info;
21 | - (void)didResolve:(Field *)field info:(GraphQLResolveInfo *)info;
22 | - (void)didParse:(id)value;
23 | - (void)didParseNull;
24 | - (void)willParse:(NSDictionary *)object;
25 | - (void)didParseJSONObject:(NSDictionary *)object;
26 | - (void)willParseElements:(NSArray *)array;
27 | - (void)willParseElementAtIndex:(NSInteger)index;
28 | - (void)didParseElementAtIndex:(NSInteger)index;
29 | - (void)didParseElements:(NSArray *)array;
30 |
31 | @end
32 |
33 | @interface GraphQLResultReader : NSObject
34 | @property (nonatomic, strong) NSDictionary *dataEntry;
35 | @property (nonatomic, strong) NSDictionary > *variables;
36 | @property (nonatomic, strong) GraphQLResolver resolver;
37 | @property (nonatomic, weak) id delegate;
38 | @property (nonatomic, strong) NSMutableArray *> *objectStack;
39 |
40 | @property (nonatomic, strong) GraphQLResolveInfo *resolveInfo;
41 |
42 | - (NSDictionary *)currentObject;
43 | - (instancetype)initWithVariables:(NSDictionary > *)variables resolver:(GraphQLResolver)resolver;
44 | - (instancetype)initWithRootObject:(NSDictionary *)rootObject;
45 | - (id)valueForField:(Field *)field;
46 | - (id)listForField:(Field *)field;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/ApolloClient.h:
--------------------------------------------------------------------------------
1 | //
2 | // ApolloClient.h
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 3/30/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GraphQLOperation.h"
11 | #import "GraphQLResult.h"
12 | #import "NetworkTransport.h"
13 | #import "ApolloStore.h"
14 | #import "OperationResultHandler.h"
15 |
16 | typedef NS_ENUM(NSUInteger, CachePolicy) {
17 | // Return data from the cache if available, else fetch results from the server.
18 | CachePolicyReturnCacheDataElseFetch,
19 | // Always fetch results from the server.
20 | CachePolicyFetchIgnoringCacheData,
21 | // Return data from the cache if available, else return nil.
22 | CachePolicyReturnCacheDataDontFetch,
23 | };
24 |
25 | @class FetchQueryOperation;
26 | @class GraphQLQueryWatcher;
27 | @interface ApolloClient : NSObject
28 | @property (nonatomic, strong) id networkTransport;
29 | @property (nonatomic, strong) ApolloStore *store;
30 | @property (nonatomic) CacheKeyForObject cacheKeyForObject;
31 | @property (nonatomic) dispatch_queue_t queue;
32 | @property (nonatomic, strong) NSOperationQueue *operationQueue;
33 |
34 | - (instancetype)initWithNetworkTransport:(id)networkTransport store:(ApolloStore *)store;
35 | - (instancetype)initWithUrl:(NSURL *)url;
36 |
37 | - (id)fetch:(GraphQLQuery *)query resultHandler:(OperationResultHandler)resultHandler;
38 | - (GraphQLQueryWatcher *)watch:(GraphQLQuery *)query resultHandler:(OperationResultHandler)resultHandler;
39 | - (id)perform:(GraphQLMutation *)mutation queue:(dispatch_queue_t)queue resultHandler:(OperationResultHandler)resultHandler;
40 |
41 | - (id)_fetch:(GraphQLQuery *)query cachePolicy:(CachePolicy)cachePolicy context:(NSInteger)context queue:(dispatch_queue_t)queue resultHandler:(OperationResultHandler)resultHandler;
42 | - (id)send:(GraphQLOperation *)Operation context:(NSInteger)context handlerQueue:(dispatch_queue_t)handlerQueue resultHandler:(OperationResultHandler)resultHandler;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/RecordSet.m:
--------------------------------------------------------------------------------
1 | //
2 | // RecordSet.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "RecordSet.h"
10 | #import "NSArray+Map.h"
11 |
12 | @implementation RecordSet
13 |
14 | - (instancetype)init:(NSArray *)records {
15 | self = [super init];
16 | if (self) {
17 | self.storage = [NSMutableDictionary dictionary];
18 | if (records) {
19 | [self insertContentsOf:records];
20 | }
21 | }
22 | return self;
23 | }
24 |
25 | - (BOOL)isEmpty {
26 | return self.storage.allKeys.count <= 0;
27 | }
28 |
29 | - (void)insert:(Record *)record {
30 | self.storage[record.key] = record;
31 | }
32 |
33 | - (void)insertContentsOf:(NSArray *)records {
34 | for (Record *record in records) {
35 | [self insert:record];
36 | }
37 | }
38 |
39 | - (Record *)recordForKey:(NSString *)key {
40 | return self.storage[key];
41 | }
42 |
43 | - (NSSet *)mergeRecords:(RecordSet *)records {
44 | NSMutableSet *changedKeys = [NSMutableSet set];
45 | for (Record *record in records.storage.allValues) {
46 | [changedKeys unionSet:[self mergeRecord:record]];
47 | }
48 | return changedKeys;
49 | }
50 |
51 | - (NSSet *)mergeRecord:(Record *)record {
52 | Record *oldRecord = self.storage[record.key];
53 | if (oldRecord) {
54 | [self.storage removeObjectForKey:record.key];
55 | NSMutableSet *changedKeys = [NSMutableSet set];
56 | for (NSString *key in record.fields.allKeys) {
57 | id oldValue = oldRecord.fields[key];
58 | id value = record.fields[key];
59 | if ([oldValue isEqual:value]) {
60 | continue;
61 | }
62 | oldRecord.fields[key] = value;
63 | [changedKeys addObject:[@[record.key, key] componentsJoinedByString:@"."]];
64 | }
65 | self.storage[record.key] = oldRecord;
66 | return changedKeys;
67 | } else {
68 | self.storage[record.key] = record;
69 | return [NSSet setWithArray:[record.fields.allKeys map:^id(NSString *obj, NSUInteger idx) {
70 | return [@[record.key, obj] componentsJoinedByString:@"."];
71 | }]];
72 | };
73 | }
74 |
75 | @end
76 |
--------------------------------------------------------------------------------
/Apollo_OC/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResponse.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResponse.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLResponse.h"
10 | #import "GraphQLError.h"
11 | #import "GraphQLResultNormalizer.h"
12 | #import "ApolloStore.h"
13 | #import "GraphQLResult.h"
14 | #import "NSArray+Map.h"
15 |
16 | @implementation GraphQLResponse
17 |
18 | - (instancetype)initWithOperation:(GraphQLOperation *)operation body:(NSDictionary *)body {
19 | self = [super init];
20 | if (self) {
21 | self.operation = operation;
22 | self.body = body;
23 | }
24 | return self;
25 | }
26 |
27 | - (ApolloTuple *)parseResult:(CacheKeyForObject)cacheKeyForObject {
28 | GraphQLOperation *data = nil;
29 | NSSet *dependentKeys = nil;
30 | RecordSet *records = nil;
31 |
32 | NSDictionary *dataEntry = (NSDictionary *)self.body[@"data"];
33 | if (dataEntry) {
34 | GraphQLResultReader *reader = [[GraphQLResultReader alloc] initWithVariables:self.operation.variables resolver:^id(Field *field, NSDictionary *object, GraphQLResolveInfo *info) {
35 | return (object ?: dataEntry)[field.responseName];
36 | }];
37 |
38 | reader.dataEntry = dataEntry;
39 |
40 | GraphQLResultNormalizer *normalizer = [[GraphQLResultNormalizer alloc] initWithRootKey:[ApolloStore rootKeyForOperation:self.operation]];
41 | normalizer.cacheKeyForObject = cacheKeyForObject;
42 | reader.delegate = normalizer;
43 |
44 | data = [[[self.operation responseDataClass] alloc] initWithReader:reader];
45 |
46 | records = normalizer.records;
47 | dependentKeys = normalizer.dependentKeys;
48 | }
49 |
50 | NSArray *errors = nil;
51 | NSArray *> *errorsEntry = self.body[@"errors"];
52 | if (errorsEntry) {
53 | errors = [errorsEntry map:^id(id obj, NSUInteger idx) {
54 | return [[GraphQLError alloc] initWithObject:obj];
55 | }];
56 | }
57 | GraphQLResult *result = [[GraphQLResult alloc] initWithData:data errors:errors dependentKeys:dependentKeys];
58 | return [ApolloTuple withFirst:result second:records];
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/FetchQueryOperation.m:
--------------------------------------------------------------------------------
1 | //
2 | // FetchQueryOperation.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "FetchQueryOperation.h"
10 |
11 | @implementation FetchQueryOperation
12 |
13 | - (instancetype)initWithClient:(ApolloClient *)client query:(GraphQLQuery *)query cachePolicy:(CachePolicy)cachePolicy context:(NSInteger)context handlerQueue:(dispatch_queue_t)handlerQueue resultHandler:(OperationResultHandler)resultHandler {
14 | self = [super init];
15 | if (self) {
16 | self.client = client;
17 | self.query = query;
18 | self.cachePolicy = cachePolicy;
19 | self.context = context;
20 | self.handlerQueue = handlerQueue;
21 | self.resultHandler = resultHandler;
22 | }
23 | return self;
24 | }
25 |
26 | - (void)start {
27 | if (self.isCancelled) {
28 | self.state = StateFinished;
29 | return;
30 | }
31 | self.state = StateExecuting;
32 |
33 | if (self.cachePolicy == CachePolicyFetchIgnoringCacheData) {
34 | [self fetchFromNetwork];
35 | return;
36 | }
37 |
38 | [self.client.store loadQuery:self.query cacheKeyForObject:self.client.cacheKeyForObject resultHandler:^(GraphQLResult *result, NSError *error) {
39 | if (error) {
40 | [self notifyResultHandlerWithResult:result error:error];
41 | self.state = StateFinished;
42 | return;
43 | }
44 | if (self.isCancelled) {
45 | self.state = StateFinished;
46 | return;
47 | }
48 | if (self.cachePolicy == CachePolicyReturnCacheDataDontFetch) {
49 | [self notifyResultHandlerWithResult:nil error:nil];
50 | self.state = StateFinished;
51 | return;
52 | }
53 | [self fetchFromNetwork];
54 | }];
55 | }
56 |
57 | - (void)fetchFromNetwork {
58 | self.networkTask = [self.client send:self.query context:self.context handlerQueue:self.handlerQueue resultHandler:^(GraphQLResult *result, NSError *error) {
59 | [self notifyResultHandlerWithResult:result error:error];
60 | self.state = StateFinished;
61 | }];
62 | }
63 |
64 | - (void)cancel {
65 | [super cancel];
66 | [self.networkTask cancel];
67 | }
68 |
69 | - (void)notifyResultHandlerWithResult:(GraphQLResult *)result error:(NSError *)error {
70 | if (self.resultHandler) {
71 | dispatch_async(self.handlerQueue, ^{
72 | self.resultHandler(result, error);
73 | });
74 | }
75 | }
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/HTTPNetworkTransport.m:
--------------------------------------------------------------------------------
1 | //
2 | // HTTPNetworkTransport.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/14/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "HTTPNetworkTransport.h"
10 | #import "NSHTTPURLResponse+Utilities.h"
11 |
12 | @implementation HTTPNetworkTransport
13 |
14 | - (instancetype)initWithUrl:(NSURL *)url configuration:(NSURLSessionConfiguration *)configuration {
15 | self = [super init];
16 | if (self) {
17 | self.url = url;
18 | if (configuration) {
19 | self.session = [NSURLSession sessionWithConfiguration:configuration];
20 | } else {
21 | self.session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
22 | }
23 | self.serializationFormat = [[JSONSerializationFormat alloc] init];
24 | }
25 | return self;
26 | }
27 |
28 | - (id)send:(GraphQLOperation *)operation completionHandler:(void(^)(GraphQLResponse *response, NSError *error))completionHandler {
29 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.url];
30 | request.HTTPMethod = @"POST";
31 | [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
32 | NSDictionary >*body = @{@"query" : operation.queryDocument,
33 | @"variables" : operation.variables
34 | };
35 | request.HTTPBody = [self.serializationFormat serialize:(id)body];
36 | NSURLSessionDataTask *task = [self.session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
37 | if (error) {
38 | completionHandler(nil, error);
39 | return;
40 | }
41 | if (![response isKindOfClass:[NSHTTPURLResponse class]]) {
42 | NSAssert(NO, @"Response should be an HTTPURLResponse");
43 | return;
44 | }
45 | if (![(NSHTTPURLResponse *)response isSuccessful] && !data) {
46 | completionHandler (nil, error);
47 | return;
48 | }
49 | if (!data) {
50 | completionHandler (nil, error);
51 | return;
52 | }
53 | NSDictionary *responseObject = [self.serializationFormat deserialize:data];
54 | if (![responseObject isKindOfClass:[NSDictionary class]]) {
55 | NSAssert(NO, @"invalidResponse");
56 | return;
57 | }
58 | GraphQLResponse *graphQLResponse = [[GraphQLResponse alloc] initWithOperation:operation body:responseObject];
59 | completionHandler(graphQLResponse, error);
60 | }];
61 |
62 | [task resume];
63 |
64 | return (id)task;
65 | }
66 |
67 | @end
68 |
--------------------------------------------------------------------------------
/graphql-ios.xcodeproj/xcuserdata/Travel.xcuserdatad/xcschemes/graphql-ios.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResultReader.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResultReader.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/18/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLResultReader.h"
10 |
11 | @implementation GraphQLResolveInfo
12 |
13 | - (instancetype)init {
14 | self = [super init];
15 | if (self) {
16 | self.path = [NSMutableArray array];
17 | }
18 | return self;
19 | }
20 |
21 | @end
22 |
23 | @implementation GraphQLResultReader
24 |
25 | - (NSDictionary *)currentObject {
26 | return self.objectStack.lastObject;
27 | }
28 |
29 | - (instancetype)initWithVariables:(NSDictionary > *)variables resolver:(GraphQLResolver)resolver {
30 | self = [super init];
31 | if (self) {
32 | self.variables = variables ?: [NSMutableDictionary dictionary];
33 | self.resolver = resolver;
34 | self.resolveInfo = [[GraphQLResolveInfo alloc] init];
35 | self.objectStack = [NSMutableArray array];
36 | }
37 | return self;
38 | }
39 |
40 | - (instancetype)initWithRootObject:(NSDictionary *)rootObject {
41 | self = [self initWithVariables:nil resolver:^id(Field *field, NSDictionary *object, GraphQLResolveInfo *info) {
42 | NSDictionary *goodObj = object ?: rootObject;
43 | if (goodObj) {
44 | return goodObj[field.responseName];
45 | }
46 | return nil;
47 | }];
48 | return self;
49 | }
50 |
51 | #pragma mark - Helpers
52 |
53 | - (id)resolve:(Field *)field parse:(SEL)parse {
54 | if (!parse) {
55 | NSAssert(NO, nil);
56 | }
57 | [self.resolveInfo.path addObject:field.responseName];
58 | if (self.delegate) {
59 | [self.delegate willResolve:field info:self.resolveInfo];
60 | }
61 | @try {
62 | id value = self.resolver(field, self.currentObject, self.resolveInfo);
63 | #pragma clang diagnostic push
64 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
65 | id parsedValue = [self performSelector:parse withObject:value];
66 | #pragma clang diagnostic pop
67 | [self notifyIfNil:parsedValue];
68 |
69 | [self.resolveInfo.path removeLastObject];
70 | if (self.delegate) {
71 | [self.delegate didResolve:field info:self.resolveInfo];
72 | }
73 |
74 | return parsedValue;
75 | } @catch (NSException *exception) {
76 | @throw exception;
77 | }
78 | }
79 |
80 | - (NSArray *)map:(NSArray *)array parse:(SEL)parse {
81 | if (self.delegate) {
82 | [self.delegate willParseElements:array];
83 | }
84 |
85 | NSMutableArray *mappedList = [NSMutableArray arrayWithCapacity:array.count];
86 |
87 | [array enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
88 | [self.resolveInfo.path addObject:[@(idx) stringValue]];
89 | if (self.delegate) {
90 | [self.delegate willParseElementAtIndex:idx];
91 | }
92 | #pragma clang diagnostic push
93 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
94 | id parsedValue = [self performSelector:parse withObject:obj];
95 | #pragma clang diagnostic pop
96 | [self notifyIfNil:parsedValue];
97 | [mappedList addObject:parsedValue];
98 | if (self.delegate) {
99 | [self.delegate didParseElementAtIndex:idx];
100 | }
101 | [self.resolveInfo.path removeLastObject];
102 | }];
103 |
104 | if (self.delegate) {
105 | [self.delegate didParseElements:array];
106 | }
107 |
108 | return mappedList;
109 | }
110 |
111 | - (void)notifyIfNil:(id)value {
112 | if (value && self.delegate) {
113 | [self.delegate didParseNull];
114 | }
115 | }
116 |
117 | - (id)valueForField:(Field *)field {
118 | return [self resolve:field parse:@selector(parse:)];
119 | }
120 |
121 | - (id)listForField:(Field *)field {
122 | return [self resolve:field parse:@selector(parse:)];
123 | }
124 |
125 | - (id)parse:(id)value {
126 | return value;
127 | }
128 |
129 | @end
130 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/GraphQLResultNormalizer.m:
--------------------------------------------------------------------------------
1 | //
2 | // GraphQLResultNormalizer.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/13/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "GraphQLResultNormalizer.h"
10 | #import "GraphQLResultReader.h"
11 |
12 | @interface GraphQLResultNormalizer ()
13 | @property (nonatomic, strong) NSMutableArray *recordStack;
14 | @property (nonatomic, strong) Record *currentRecord;
15 | @property (nonatomic, strong) NSMutableArray *> *pathStack;
16 | @property (nonatomic, strong) NSMutableArray *path;
17 | @property (nonatomic, strong) NSMutableArray *valueStack;
18 | @end
19 |
20 | @implementation GraphQLResultNormalizer
21 |
22 | - (instancetype)init {
23 | self = [super init];
24 | if (self) {
25 | self.dependentKeys = [NSMutableSet set];
26 | self.pathStack = [NSMutableArray array];
27 | self.path = [NSMutableArray array];
28 | self.valueStack = [NSMutableArray array];
29 | }
30 | return self;
31 | }
32 |
33 | - (instancetype)initWithRootKey:(NSString *)rootKey {
34 | self = [self init];
35 | self.records = [[RecordSet alloc] init:nil];
36 | self.recordStack = [NSMutableArray array];
37 | self.currentRecord = [[Record alloc] initWithKey:rootKey fields:nil];
38 | return self;
39 | }
40 |
41 | - (void)willResolve:(Field *)field info:(GraphQLResolveInfo *)info {
42 | [self.path addObject:field.cacheKey];
43 | }
44 |
45 | - (void)didResolve:(Field *)field info:(GraphQLResolveInfo *)info {
46 | [self.path removeLastObject];
47 |
48 | id value = self.valueStack.lastObject;
49 | [self.valueStack removeObject:value];
50 |
51 | NSString *dependentKey = [@[self.currentRecord.key, field.cacheKey] componentsJoinedByString:@"."];
52 | [self.dependentKeys addObject:dependentKey];
53 |
54 | [self.currentRecord setRecordValue:value forKey:field.cacheKey];
55 |
56 | if (self.recordStack.count <= 0) {
57 | [self.records mergeRecord:self.currentRecord];
58 | }
59 | }
60 |
61 | - (void)didParse:(id)value {
62 | [self.valueStack addObject:value];
63 | }
64 |
65 | - (void)didParseNull {
66 | [self.valueStack addObject:[NSNull null]];
67 | }
68 |
69 | - (void)willParse:(NSDictionary *)object {
70 | [self.pathStack addObject:self.path];
71 |
72 | NSString *cacheKey;
73 | if (self.cacheKeyForObject && self.cacheKeyForObject(object)) {
74 | id value = self.cacheKeyForObject(object);
75 | // cacheKey = String(describing: value)
76 | cacheKey = [value description];
77 | self.path = [NSMutableArray arrayWithObject:cacheKey];
78 | } else {
79 | cacheKey = [self.path componentsJoinedByString:@"."];
80 | }
81 | [self.recordStack addObject:self.currentRecord];
82 | self.currentRecord = [[Record alloc] initWithKey:cacheKey fields:nil];
83 | }
84 |
85 | - (void)didParseJSONObject:(NSDictionary *)object {
86 | self.path = self.pathStack.lastObject.mutableCopy;
87 | [self.pathStack removeObject:self.path];
88 |
89 | Reference *reference = [[Reference alloc] initWithKey:self.currentRecord.key];
90 | [self.valueStack addObject:reference];
91 | [self.dependentKeys addObject:self.currentRecord.key];
92 | [self.records mergeRecord:self.currentRecord];
93 | self.currentRecord = self.recordStack.lastObject;
94 | [self.recordStack removeObject:self.currentRecord];
95 | }
96 |
97 | - (void)willParseElements:(NSArray *)array {
98 | // valueStack.reserveCapacity(valueStack.count + array.count)
99 | }
100 |
101 | - (void)willParseElementAtIndex:(NSInteger)index {
102 | [self.path addObject:[@(index) stringValue]];
103 | }
104 |
105 | - (void)didParseElementAtIndex:(NSInteger)index {
106 | [self.path removeLastObject];
107 | }
108 |
109 | - (void)didParseElements:(NSArray *)array {
110 | NSInteger location = 0;
111 | if (array.count < self.valueStack.count) {
112 | location = self.valueStack.count - array.count;
113 | }
114 | NSArray *parsedArray = [NSArray arrayWithArray:[self.valueStack subarrayWithRange:NSMakeRange(location, array.count)]];
115 | [self.valueStack removeObjectsInRange:NSMakeRange(location, array.count)];
116 | [self.valueStack addObject:parsedArray];
117 | }
118 |
119 | @end
120 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/ApolloStore.m:
--------------------------------------------------------------------------------
1 | //
2 | // ApolloStore.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 4/12/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "ApolloStore.h"
10 | #import "GraphQLResult.h"
11 | #import "ApolloClient.h"
12 | #import "CacheKeyForObject.h"
13 | #import "GraphQLResultReader.h"
14 | #import "GraphQLResultNormalizer.h"
15 | #import "NSArray+Map.h"
16 |
17 | @implementation ApolloStore
18 |
19 | - (instancetype)init {
20 | self = [super init];
21 | if (self) {
22 | self.queue = dispatch_queue_create("com.apollographql.ApolloStore", DISPATCH_CURRENT_QUEUE_LABEL);
23 | self.subscribers = [NSMutableArray array];
24 | self.records = [[RecordSet alloc] init];
25 | }
26 | return self;
27 | }
28 |
29 | - (instancetype)initWithRecords:(RecordSet *)records {
30 | self = [self init];
31 | self.records = records;
32 | return self;
33 | }
34 |
35 | + (NSString *)rootKeyForOperation:(GraphQLOperation *)operation {
36 | if ([operation isKindOfClass:[GraphQLQuery class]]) {
37 | return @"QUERY_ROOT";
38 | } else if ([operation isKindOfClass:[GraphQLMutation class]]) {
39 | return @"MUTATION_ROOT";
40 | }
41 | NSAssert(NO, @"Unknown operation type");
42 | return nil;
43 | }
44 |
45 | - (void)publish:(RecordSet *)records context:(NSInteger)context {
46 | dispatch_barrier_async(self.queue, ^{
47 | NSSet *changedKeys = [self.records mergeRecords:records];
48 | for (ApolloStoreSubscriber *subscriber in self.subscribers) {
49 | [subscriber store:self didChangeKeys:changedKeys context:context];
50 | }
51 | });
52 | }
53 |
54 | - (void)subscribe:(ApolloStoreSubscriber *)subscriber {
55 | dispatch_barrier_async(self.queue, ^{
56 | [self.subscribers addObject:subscriber];
57 | });
58 | }
59 |
60 | - (void)unsubscribe:(ApolloStoreSubscriber *)subscriber {
61 | dispatch_barrier_async(self.queue, ^{
62 | [self.subscribers removeObject:subscriber];
63 | });
64 | }
65 |
66 | - (void)loadQuery:(GraphQLQuery *)query cacheKeyForObject:(CacheKeyForObject)cacheKeyForObject resultHandler:(OperationResultHandler)resultHandler {
67 | dispatch_async(self.queue, ^{
68 | @try {
69 | NSString *rootKey = [ApolloStore rootKeyForOperation:query];
70 | Record *rootRecord = [self.records recordForKey:rootKey];
71 | NSDictionary *rootObject = rootRecord ? rootRecord.fields : nil;
72 | GraphQLResultReader *reader = [[GraphQLResultReader alloc] initWithVariables:query.variables resolver:^id(Field *field, NSDictionary *object, GraphQLResolveInfo *info) {
73 | id goodObject = object ?: rootObject;
74 | NSDictionary *value = goodObject[field.cacheKey];
75 | return [self complete:value];
76 | }];
77 | GraphQLResultNormalizer *normalizer = [[GraphQLResultNormalizer alloc] initWithRootKey:rootKey];
78 | normalizer.cacheKeyForObject = cacheKeyForObject;
79 |
80 | reader.delegate = normalizer;
81 |
82 | Class ResponseDataClass = [query responseDataClass];
83 |
84 | id data = [[ResponseDataClass alloc] initWithReader:reader];
85 | NSSet *dependentKeys = normalizer.dependentKeys;
86 | GraphQLResult *result = [[GraphQLResult alloc] initWithData:data errors:nil dependentKeys:dependentKeys];
87 | resultHandler(result, nil);
88 | } @catch (NSException *exception) {
89 | resultHandler(nil, [NSError errorWithDomain:exception.name code:0 userInfo:exception.userInfo]);
90 | }
91 | });
92 | }
93 |
94 | - (id)complete:(id)value {
95 | if ([value isKindOfClass:[Reference class]]) {
96 | Reference *reference = value;
97 | Record *record = [self.records recordForKey:reference.key];
98 | return record ? record.fields : nil;
99 | } else if ([value isKindOfClass:[NSArray class]]) {
100 | NSArray *array = value;
101 | NSArray *completedValues = [array map:^id(id obj, NSUInteger idx) {
102 | return [self complete:obj];
103 | }];
104 | return completedValues;
105 | } else {
106 | return value;
107 | }
108 | }
109 |
110 | @end
111 |
112 |
113 | @implementation ApolloStoreSubscriber
114 |
115 | - (void)store:(ApolloStore *)store didChangeKeys:(NSSet *)changedKeys context:(NSInteger)context {
116 | NSAssert(NO, @"Should not get here");
117 | }
118 |
119 | @end
120 |
--------------------------------------------------------------------------------
/Apollo.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod spec lint BLAPIManagers.podspec' to ensure this is a
3 | # valid spec and to remove all comments including this before submitting the spec.
4 | #
5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7 | #
8 |
9 | Pod::Spec.new do |s|
10 |
11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12 | #
13 | # These will help people to find your library, and whilst it
14 | # can feel like a chore to fill in it's definitely to your advantage. The
15 | # summary should be tweet-length, and the description more in depth.
16 | #
17 |
18 | s.name = "graphql-ios"
19 | s.version = "0.0.9"
20 | s.summary = "apollo-ios objective-c port."
21 |
22 | # This description is used to generate tags and improve search results.
23 | # * Think: What does it do? Why did you write it? What is the focus?
24 | # * Try to keep it short, snappy and to the point.
25 | # * Write the description between the DESC delimiters below.
26 | # * Finally, don't worry about the indent, CocoaPods strips it!
27 | s.description = <<-DESC
28 | apollo-ios objective-c port
29 | DESC
30 |
31 | s.homepage = "https://github.com/funcompany/graphql-ios"
32 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
33 |
34 |
35 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
36 | #
37 | # Licensing your code is important. See http://choosealicense.com for more info.
38 | # CocoaPods will detect a license file if there is a named LICENSE*
39 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
40 | #
41 |
42 | # s.license = "MIT (example)"
43 | s.license = { :type => "MIT", :file => "FILE_LICENSE" }
44 |
45 |
46 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
47 | #
48 | # Specify the authors of the library, with email addresses. Email addresses
49 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
50 | # accepts just a name if you'd rather not provide an email address.
51 | #
52 | # Specify a social_media_url where others can refer to, for example a twitter
53 | # profile URL.
54 | #
55 |
56 | s.author = { "Travel" => "chuchuanming@gmail.com" }
57 |
58 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
59 | #
60 | # If this Pod runs only on iOS or OS X, then specify the platform and
61 | # the deployment target. You can optionally include the target after the platform.
62 | #
63 |
64 | # s.platform = :ios
65 | s.platform = :ios, "9.0"
66 |
67 | # When using multiple platforms
68 | # s.ios.deployment_target = "5.0"
69 | # s.osx.deployment_target = "10.7"
70 | # s.watchos.deployment_target = "2.0"
71 | # s.tvos.deployment_target = "9.0"
72 |
73 |
74 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
75 | #
76 | # Specify the location from where the source should be retrieved.
77 | # Supports git, hg, bzr, svn and HTTP.
78 | #
79 |
80 | s.source = { :git => "https://github.com/funcompany/graphql-ios.git", :tag => s.version.to_s }
81 |
82 |
83 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
84 | #
85 | # CocoaPods is smart about how it includes source code. For source files
86 | # giving a folder will include any swift, h, m, mm, c & cpp files.
87 | # For header files it will include any header in the folder.
88 | # Not including the public_header_files will make all headers public.
89 | #
90 |
91 | s.source_files = "Apollo_OC/Apollo/**/*.{h,m}"
92 | # s.exclude_files = "Classes/Exclude"
93 |
94 | # s.public_header_files = "Classes/**/*.h"
95 |
96 |
97 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
98 | #
99 | # A list of resources included with the Pod. These are copied into the
100 | # target bundle with a build phase script. Anything else will be cleaned.
101 | # You can preserve files from being cleaned, please don't preserve
102 | # non-essential files like tests, examples and documentation.
103 | #
104 |
105 | # s.resource = "icon.png"
106 | # s.resources = "Apollo_OC/Apollo_OC/**/*.storyboard"
107 |
108 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave"
109 |
110 |
111 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
112 | #
113 | # Link your library with frameworks, or libraries. Libraries do not include
114 | # the lib prefix of their name.
115 | #
116 |
117 | # s.framework = "SomeFramework"
118 | # s.frameworks = "SomeFramework", "AnotherFramework"
119 |
120 | # s.library = "iconv"
121 | # s.libraries = "iconv", "xml2"
122 |
123 |
124 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
125 | #
126 | # If your library depends on compiler flags you can set them in the xcconfig hash
127 | # where they will only apply to your library. If you depend on other Podspecs
128 | # you can include multiple dependencies to ensure it works.
129 |
130 | s.requires_arc = true
131 |
132 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
133 | # s.dependency "BLNetworking"
134 | # s.dependency "BLAPIManagers"
135 | # s.dependency "BLMediator"
136 |
137 | end
138 |
--------------------------------------------------------------------------------
/Apollo_OC/Apollo/ApolloClient.m:
--------------------------------------------------------------------------------
1 | //
2 | // ApolloClient.m
3 | // Apollo_OC
4 | //
5 | // Created by Travel Chu on 3/30/17.
6 | // Copyright © 2017 Midtown Doornail. All rights reserved.
7 | //
8 |
9 | #import "ApolloClient.h"
10 | #import "HTTPNetworkTransport.h"
11 | #import "FetchQueryOperation.h"
12 | #import "GraphQLQueryWatcher.h"
13 |
14 | @implementation ApolloClient
15 |
16 | - (instancetype)initWithNetworkTransport:(id)networkTransport store:(ApolloStore *)store {
17 | self = [super init];
18 | if (self) {
19 | self.networkTransport = networkTransport;
20 | self.store = store ?: [[ApolloStore alloc] init];
21 | self.queue = dispatch_queue_create("com.apollographql.ApolloClient", DISPATCH_CURRENT_QUEUE_LABEL);
22 | self.operationQueue = [[NSOperationQueue alloc] init];
23 | }
24 | return self;
25 | }
26 |
27 | - (instancetype)initWithUrl:(NSURL *)url {
28 | return [self initWithNetworkTransport:[[HTTPNetworkTransport alloc] initWithUrl:url configuration:nil] store:self.store];
29 | }
30 |
31 |
32 | /// Fetches a query from the server or from the local cache, depending on the current contents of the cache and the specified cache policy.
33 | ///
34 | /// - Parameters:
35 | /// - query: The query to fetch.
36 | /// - cachePolicy: A cache policy that specifies when results should be fetched from the server and when data should be loaded from the local cache.
37 | /// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue.
38 | /// - resultHandler: An optional closure that is called when query results are available or when an error occurs.
39 | /// - result: The result of the fetched query, or `nil` if an error occurred.
40 | /// - error: An error that indicates why the fetch failed, or `nil` if the fetch was succesful.
41 | /// - Returns: An object that can be used to cancel an in progress fetch.
42 | - (id)fetch:(GraphQLQuery *)query resultHandler:(OperationResultHandler)resultHandler {
43 | return [self _fetch:query cachePolicy:CachePolicyReturnCacheDataElseFetch context:-1 queue:dispatch_get_main_queue() resultHandler:resultHandler];
44 | }
45 |
46 | - (id)_fetch:(GraphQLQuery *)query cachePolicy:(CachePolicy)cachePolicy context:(NSInteger)context queue:(dispatch_queue_t)queue resultHandler:(OperationResultHandler)resultHandler {
47 | // If we don't have to go through the cache, there is no need to create an operation
48 | // and we can return a network task directly
49 | if (cachePolicy == CachePolicyFetchIgnoringCacheData) {
50 | return [self send:query context:context handlerQueue:queue resultHandler:resultHandler];
51 | } else {
52 | FetchQueryOperation *operation = [[FetchQueryOperation alloc] initWithClient:self query:query cachePolicy:cachePolicy context:context handlerQueue:queue resultHandler:resultHandler];
53 | [self.operationQueue addOperation:operation];
54 | return operation;
55 | }
56 | }
57 |
58 | /// Watches a query by first fetching an initial result from the server or from the local cache, depending on the current contents of the cache and the specified cache policy. After the initial fetch, the returned query watcher object will get notified whenever any of the data the query result depends on changes in the local cache, and calls the result handler again with the new result.
59 | ///
60 | /// - Parameters:
61 | /// - query: The query to fetch.
62 | /// - cachePolicy: A cache policy that specifies when results should be fetched from the server or from the local cache.
63 | /// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue.
64 | /// - resultHandler: An optional closure that is called when query results are available or when an error occurs.
65 | /// - result: The result of the fetched query, or `nil` if an error occurred.
66 | /// - error: An error that indicates why the fetch failed, or `nil` if the fetch was succesful.
67 | /// - Returns: A query watcher object that can be used to control the watching behavior.
68 | - (GraphQLQueryWatcher *)watch:(GraphQLQuery *)query resultHandler:(OperationResultHandler)resultHandler {
69 | GraphQLQueryWatcher *watcher = [[GraphQLQueryWatcher alloc] initWithClient:self query:query handlerQueue:dispatch_get_main_queue() resultHandler:resultHandler];
70 | [watcher fetch:CachePolicyReturnCacheDataElseFetch];
71 | return watcher;
72 | }
73 |
74 |
75 | /// Performs a mutation by sending it to the server.
76 | ///
77 | /// - Parameters:
78 | /// - mutation: The mutation to perform.
79 | /// - queue: A dispatch queue on which the result handler will be called. Defaults to the main queue.
80 | /// - resultHandler: An optional closure that is called when mutation results are available or when an error occurs.
81 | /// - result: The result of the performed mutation, or `nil` if an error occurred.
82 | /// - error: An error that indicates why the mutation failed, or `nil` if the mutation was succesful.
83 | /// - Returns: An object that can be used to cancel an in progress mutation.
84 | - (id)perform:(GraphQLMutation *)mutation queue:(dispatch_queue_t)queue resultHandler:(OperationResultHandler)resultHandler {
85 | if (!queue) {
86 | queue = dispatch_get_main_queue();
87 | }
88 | return [self _perform:mutation context:-1 queue:queue resultHandler:resultHandler];
89 | }
90 |
91 | - (id)_perform:(GraphQLMutation *)mutation context:(NSInteger)context queue:(dispatch_queue_t)queue resultHandler:(OperationResultHandler)resultHandler {
92 | return [self send:mutation context:context handlerQueue:queue resultHandler:resultHandler];
93 | }
94 |
95 | - (id)send:(GraphQLOperation *)Operation context:(NSInteger)context handlerQueue:(dispatch_queue_t)handlerQueue resultHandler:(OperationResultHandler)resultHandler {
96 | return [self.networkTransport send:Operation completionHandler:^(GraphQLResponse *response, NSError *error) {
97 | if (!response) {
98 | [self notifyResultHandler:nil error:error handlerQueue:handlerQueue resultHandler:resultHandler];
99 | return;
100 | }
101 | dispatch_async(self.queue, ^{
102 | @try {
103 | ApolloTuple *tuple = [response parseResult:self.cacheKeyForObject];
104 | GraphQLResult *result = tuple.first;
105 | RecordSet *records = tuple.second;
106 | [self notifyResultHandler:result error:nil handlerQueue:handlerQueue resultHandler:resultHandler];
107 | if (records) {
108 | [self.store publish:records context:context];
109 | }
110 | } @catch (NSException *exception) {
111 | [self notifyResultHandler:nil error:[NSError errorWithDomain:@"" code:0 userInfo:exception.userInfo] handlerQueue:handlerQueue resultHandler:resultHandler];
112 | }
113 | });
114 | }];
115 | }
116 |
117 | - (void)notifyResultHandler:(GraphQLResult *)result error:(NSError *)error handlerQueue:(dispatch_queue_t)handlerQueue resultHandler:(OperationResultHandler)resultHandler {
118 | if (!resultHandler) {
119 | return;
120 | }
121 |
122 | dispatch_async(handlerQueue, ^{
123 | resultHandler(result, error);
124 | });
125 | }
126 |
127 | @end
128 |
--------------------------------------------------------------------------------
/Apollo_OC/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
26 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
64 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/graphql-ios.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 29F6D3A01F68F7BBF71B7239 /* libPods-Apollo_OC.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 941B04D397EF3452436A3031 /* libPods-Apollo_OC.a */; };
11 | ED52EAF31EA88855000707DB /* Apollo.podspec in Resources */ = {isa = PBXBuildFile; fileRef = ED52EAF21EA88855000707DB /* Apollo.podspec */; };
12 | ED5F68471EC5821C004D3D96 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = ED5F68461EC5821C004D3D96 /* README.md */; };
13 | ED6903621EA70EB50000A8C9 /* JSONStandardTypeConversions.m in Sources */ = {isa = PBXBuildFile; fileRef = ED6903611EA70EB50000A8C9 /* JSONStandardTypeConversions.m */; };
14 | ED6903651EA722AC0000A8C9 /* API.m in Sources */ = {isa = PBXBuildFile; fileRef = ED6903641EA722AC0000A8C9 /* API.m */; };
15 | ED69036B1EA74C080000A8C9 /* NSArray+Map.m in Sources */ = {isa = PBXBuildFile; fileRef = ED69036A1EA74C080000A8C9 /* NSArray+Map.m */; };
16 | ED69036F1EA74C7A0000A8C9 /* NSMutableArray+Concat.m in Sources */ = {isa = PBXBuildFile; fileRef = ED69036E1EA74C7A0000A8C9 /* NSMutableArray+Concat.m */; };
17 | ED6903721EA74C920000A8C9 /* NSSet+Disjoint.m in Sources */ = {isa = PBXBuildFile; fileRef = ED6903711EA74C920000A8C9 /* NSSet+Disjoint.m */; };
18 | ED87096C1EA610A200CB9BC6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ED87096B1EA610A200CB9BC6 /* main.m */; };
19 | ED87096F1EA610A200CB9BC6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ED87096E1EA610A200CB9BC6 /* AppDelegate.m */; };
20 | ED8709721EA610A200CB9BC6 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709711EA610A200CB9BC6 /* FirstViewController.m */; };
21 | ED8709751EA610A200CB9BC6 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709741EA610A200CB9BC6 /* SecondViewController.m */; };
22 | ED8709781EA610A200CB9BC6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED8709761EA610A200CB9BC6 /* Main.storyboard */; };
23 | ED87097A1EA610A200CB9BC6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED8709791EA610A200CB9BC6 /* Assets.xcassets */; };
24 | ED87097D1EA610A200CB9BC6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED87097B1EA610A200CB9BC6 /* LaunchScreen.storyboard */; };
25 | ED8709871EA610EA00CB9BC6 /* ApolloClient.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709861EA610EA00CB9BC6 /* ApolloClient.m */; };
26 | ED87098B1EA611EE00CB9BC6 /* FetchQueryOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = ED87098A1EA611EE00CB9BC6 /* FetchQueryOperation.m */; };
27 | ED87098E1EA6122F00CB9BC6 /* ApolloStore.m in Sources */ = {isa = PBXBuildFile; fileRef = ED87098D1EA6122F00CB9BC6 /* ApolloStore.m */; };
28 | ED8709981EA63FBC00CB9BC6 /* ApolloTuple.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709951EA63FBC00CB9BC6 /* ApolloTuple.m */; };
29 | ED87099C1EA6401E00CB9BC6 /* RecordSet.m in Sources */ = {isa = PBXBuildFile; fileRef = ED87099B1EA6401E00CB9BC6 /* RecordSet.m */; };
30 | ED8709A01EA6429D00CB9BC6 /* Record.m in Sources */ = {isa = PBXBuildFile; fileRef = ED87099F1EA6429D00CB9BC6 /* Record.m */; };
31 | ED8709A31EA6443E00CB9BC6 /* GraphQLResultReader.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709A21EA6443E00CB9BC6 /* GraphQLResultReader.m */; };
32 | ED8709A61EA6471D00CB9BC6 /* GraphQLTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709A51EA6471D00CB9BC6 /* GraphQLTypes.m */; };
33 | ED8709A91EA6478F00CB9BC6 /* JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709A81EA6478F00CB9BC6 /* JSON.m */; };
34 | ED8709AC1EA6481000CB9BC6 /* Field.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709AB1EA6481000CB9BC6 /* Field.m */; };
35 | ED8709AF1EA64CA900CB9BC6 /* Fragments.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709AE1EA64CA900CB9BC6 /* Fragments.m */; };
36 | ED8709B21EA64CF000CB9BC6 /* GraphQLError.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709B11EA64CEF00CB9BC6 /* GraphQLError.m */; };
37 | ED8709B71EA64D1700CB9BC6 /* GraphQLOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709B41EA64D1700CB9BC6 /* GraphQLOperation.m */; };
38 | ED8709B81EA64D1700CB9BC6 /* GraphQLQueryWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709B61EA64D1700CB9BC6 /* GraphQLQueryWatcher.m */; };
39 | ED8709BB1EA64D3D00CB9BC6 /* GraphQLResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709BA1EA64D3D00CB9BC6 /* GraphQLResponse.m */; };
40 | ED8709BE1EA64D4600CB9BC6 /* GraphQLResult.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709BD1EA64D4600CB9BC6 /* GraphQLResult.m */; };
41 | ED8709C11EA64D5B00CB9BC6 /* GraphQLResultNormalizer.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709C01EA64D5B00CB9BC6 /* GraphQLResultNormalizer.m */; };
42 | ED8709C41EA64D8500CB9BC6 /* HTTPNetworkTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709C31EA64D8500CB9BC6 /* HTTPNetworkTransport.m */; };
43 | ED8709C91EA64D9600CB9BC6 /* NSDictionary+JSONEncodable.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709C61EA64D9600CB9BC6 /* NSDictionary+JSONEncodable.m */; };
44 | ED8709CA1EA64D9600CB9BC6 /* JSONSerializationFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709C81EA64D9600CB9BC6 /* JSONSerializationFormat.m */; };
45 | ED8709CD1EA64DC300CB9BC6 /* NetworkTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709CC1EA64DC300CB9BC6 /* NetworkTransport.m */; };
46 | ED8709D01EA64DEF00CB9BC6 /* NSHTTPURLResponse+Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709CF1EA64DEF00CB9BC6 /* NSHTTPURLResponse+Utilities.m */; };
47 | ED8709D31EA66B0A00CB9BC6 /* AsynchronousOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709D21EA66B0A00CB9BC6 /* AsynchronousOperation.m */; };
48 | ED8709D91EA66FBA00CB9BC6 /* Cancellable.m in Sources */ = {isa = PBXBuildFile; fileRef = ED8709D81EA66FBA00CB9BC6 /* Cancellable.m */; };
49 | /* End PBXBuildFile section */
50 |
51 | /* Begin PBXFileReference section */
52 | 421EFCEF52199683BB61B243 /* Pods-Apollo_OC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Apollo_OC.release.xcconfig"; path = "Pods/Target Support Files/Pods-Apollo_OC/Pods-Apollo_OC.release.xcconfig"; sourceTree = ""; };
53 | 941B04D397EF3452436A3031 /* libPods-Apollo_OC.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Apollo_OC.a"; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 98F61DE28BF357E0C8CA78D1 /* Pods-Apollo_OC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Apollo_OC.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Apollo_OC/Pods-Apollo_OC.debug.xcconfig"; sourceTree = ""; };
55 | ED52EAF21EA88855000707DB /* Apollo.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Apollo.podspec; sourceTree = SOURCE_ROOT; };
56 | ED5F68461EC5821C004D3D96 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; };
57 | ED6903601EA70EB50000A8C9 /* JSONStandardTypeConversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONStandardTypeConversions.h; sourceTree = ""; };
58 | ED6903611EA70EB50000A8C9 /* JSONStandardTypeConversions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONStandardTypeConversions.m; sourceTree = ""; };
59 | ED6903631EA722AC0000A8C9 /* API.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = API.h; sourceTree = ""; };
60 | ED6903641EA722AC0000A8C9 /* API.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = API.m; sourceTree = ""; };
61 | ED6903691EA74C080000A8C9 /* NSArray+Map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Map.h"; sourceTree = ""; };
62 | ED69036A1EA74C080000A8C9 /* NSArray+Map.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Map.m"; sourceTree = ""; };
63 | ED69036D1EA74C7A0000A8C9 /* NSMutableArray+Concat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+Concat.h"; sourceTree = ""; };
64 | ED69036E1EA74C7A0000A8C9 /* NSMutableArray+Concat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+Concat.m"; sourceTree = ""; };
65 | ED6903701EA74C920000A8C9 /* NSSet+Disjoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSSet+Disjoint.h"; sourceTree = ""; };
66 | ED6903711EA74C920000A8C9 /* NSSet+Disjoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSSet+Disjoint.m"; sourceTree = ""; };
67 | ED8709671EA610A200CB9BC6 /* graphql-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "graphql-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
68 | ED87096B1EA610A200CB9BC6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
69 | ED87096D1EA610A200CB9BC6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
70 | ED87096E1EA610A200CB9BC6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
71 | ED8709701EA610A200CB9BC6 /* FirstViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; };
72 | ED8709711EA610A200CB9BC6 /* FirstViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; };
73 | ED8709731EA610A200CB9BC6 /* SecondViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; };
74 | ED8709741EA610A200CB9BC6 /* SecondViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; };
75 | ED8709771EA610A200CB9BC6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
76 | ED8709791EA610A200CB9BC6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
77 | ED87097C1EA610A200CB9BC6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
78 | ED87097E1EA610A200CB9BC6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
79 | ED8709851EA610EA00CB9BC6 /* ApolloClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApolloClient.h; sourceTree = ""; };
80 | ED8709861EA610EA00CB9BC6 /* ApolloClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApolloClient.m; sourceTree = ""; };
81 | ED8709881EA6113600CB9BC6 /* OperationResultHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperationResultHandler.h; sourceTree = ""; };
82 | ED8709891EA611EE00CB9BC6 /* FetchQueryOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchQueryOperation.h; sourceTree = ""; };
83 | ED87098A1EA611EE00CB9BC6 /* FetchQueryOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FetchQueryOperation.m; sourceTree = ""; };
84 | ED87098C1EA6122F00CB9BC6 /* ApolloStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApolloStore.h; sourceTree = ""; };
85 | ED87098D1EA6122F00CB9BC6 /* ApolloStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApolloStore.m; sourceTree = ""; };
86 | ED87098F1EA63F5E00CB9BC6 /* graphql-ios.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "graphql-ios.pch"; sourceTree = ""; };
87 | ED8709941EA63FBC00CB9BC6 /* ApolloTuple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApolloTuple.h; sourceTree = ""; };
88 | ED8709951EA63FBC00CB9BC6 /* ApolloTuple.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApolloTuple.m; sourceTree = ""; };
89 | ED87099A1EA6401E00CB9BC6 /* RecordSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordSet.h; sourceTree = ""; };
90 | ED87099B1EA6401E00CB9BC6 /* RecordSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecordSet.m; sourceTree = ""; };
91 | ED87099D1EA6412E00CB9BC6 /* CacheKeyForObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CacheKeyForObject.h; sourceTree = ""; };
92 | ED87099E1EA6429D00CB9BC6 /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = ""; };
93 | ED87099F1EA6429D00CB9BC6 /* Record.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Record.m; sourceTree = ""; };
94 | ED8709A11EA6443E00CB9BC6 /* GraphQLResultReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLResultReader.h; sourceTree = ""; };
95 | ED8709A21EA6443E00CB9BC6 /* GraphQLResultReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLResultReader.m; sourceTree = ""; };
96 | ED8709A41EA6471D00CB9BC6 /* GraphQLTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLTypes.h; sourceTree = ""; };
97 | ED8709A51EA6471D00CB9BC6 /* GraphQLTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLTypes.m; sourceTree = ""; };
98 | ED8709A71EA6478F00CB9BC6 /* JSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSON.h; sourceTree = ""; };
99 | ED8709A81EA6478F00CB9BC6 /* JSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSON.m; sourceTree = ""; };
100 | ED8709AA1EA6481000CB9BC6 /* Field.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Field.h; sourceTree = ""; };
101 | ED8709AB1EA6481000CB9BC6 /* Field.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Field.m; sourceTree = ""; };
102 | ED8709AD1EA64CA900CB9BC6 /* Fragments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Fragments.h; sourceTree = ""; };
103 | ED8709AE1EA64CA900CB9BC6 /* Fragments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Fragments.m; sourceTree = ""; };
104 | ED8709B01EA64CEF00CB9BC6 /* GraphQLError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLError.h; sourceTree = ""; };
105 | ED8709B11EA64CEF00CB9BC6 /* GraphQLError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLError.m; sourceTree = ""; };
106 | ED8709B31EA64D1700CB9BC6 /* GraphQLOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLOperation.h; sourceTree = ""; };
107 | ED8709B41EA64D1700CB9BC6 /* GraphQLOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLOperation.m; sourceTree = ""; };
108 | ED8709B51EA64D1700CB9BC6 /* GraphQLQueryWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLQueryWatcher.h; sourceTree = ""; };
109 | ED8709B61EA64D1700CB9BC6 /* GraphQLQueryWatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLQueryWatcher.m; sourceTree = ""; };
110 | ED8709B91EA64D3D00CB9BC6 /* GraphQLResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLResponse.h; sourceTree = ""; };
111 | ED8709BA1EA64D3D00CB9BC6 /* GraphQLResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLResponse.m; sourceTree = ""; };
112 | ED8709BC1EA64D4600CB9BC6 /* GraphQLResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLResult.h; sourceTree = ""; };
113 | ED8709BD1EA64D4600CB9BC6 /* GraphQLResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLResult.m; sourceTree = ""; };
114 | ED8709BF1EA64D5B00CB9BC6 /* GraphQLResultNormalizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphQLResultNormalizer.h; sourceTree = ""; };
115 | ED8709C01EA64D5B00CB9BC6 /* GraphQLResultNormalizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GraphQLResultNormalizer.m; sourceTree = ""; };
116 | ED8709C21EA64D8500CB9BC6 /* HTTPNetworkTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPNetworkTransport.h; sourceTree = ""; };
117 | ED8709C31EA64D8500CB9BC6 /* HTTPNetworkTransport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPNetworkTransport.m; sourceTree = ""; };
118 | ED8709C51EA64D9600CB9BC6 /* NSDictionary+JSONEncodable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+JSONEncodable.h"; sourceTree = ""; };
119 | ED8709C61EA64D9600CB9BC6 /* NSDictionary+JSONEncodable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+JSONEncodable.m"; sourceTree = ""; };
120 | ED8709C71EA64D9600CB9BC6 /* JSONSerializationFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONSerializationFormat.h; sourceTree = ""; };
121 | ED8709C81EA64D9600CB9BC6 /* JSONSerializationFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONSerializationFormat.m; sourceTree = ""; };
122 | ED8709CB1EA64DC300CB9BC6 /* NetworkTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkTransport.h; sourceTree = ""; };
123 | ED8709CC1EA64DC300CB9BC6 /* NetworkTransport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkTransport.m; sourceTree = ""; };
124 | ED8709CE1EA64DEF00CB9BC6 /* NSHTTPURLResponse+Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSHTTPURLResponse+Utilities.h"; sourceTree = ""; };
125 | ED8709CF1EA64DEF00CB9BC6 /* NSHTTPURLResponse+Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSHTTPURLResponse+Utilities.m"; sourceTree = ""; };
126 | ED8709D11EA66B0A00CB9BC6 /* AsynchronousOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsynchronousOperation.h; sourceTree = ""; };
127 | ED8709D21EA66B0A00CB9BC6 /* AsynchronousOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AsynchronousOperation.m; sourceTree = ""; };
128 | ED8709D71EA66FBA00CB9BC6 /* Cancellable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cancellable.h; sourceTree = ""; };
129 | ED8709D81EA66FBA00CB9BC6 /* Cancellable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cancellable.m; sourceTree = ""; };
130 | /* End PBXFileReference section */
131 |
132 | /* Begin PBXFrameworksBuildPhase section */
133 | ED8709641EA610A200CB9BC6 /* Frameworks */ = {
134 | isa = PBXFrameworksBuildPhase;
135 | buildActionMask = 2147483647;
136 | files = (
137 | 29F6D3A01F68F7BBF71B7239 /* libPods-Apollo_OC.a in Frameworks */,
138 | );
139 | runOnlyForDeploymentPostprocessing = 0;
140 | };
141 | /* End PBXFrameworksBuildPhase section */
142 |
143 | /* Begin PBXGroup section */
144 | 771C40CCBC07547C26783C72 /* Pods */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 98F61DE28BF357E0C8CA78D1 /* Pods-Apollo_OC.debug.xcconfig */,
148 | 421EFCEF52199683BB61B243 /* Pods-Apollo_OC.release.xcconfig */,
149 | );
150 | name = Pods;
151 | sourceTree = "";
152 | };
153 | ED87095E1EA610A200CB9BC6 = {
154 | isa = PBXGroup;
155 | children = (
156 | ED8709691EA610A200CB9BC6 /* graphql-ios */,
157 | ED8709681EA610A200CB9BC6 /* Products */,
158 | 771C40CCBC07547C26783C72 /* Pods */,
159 | F88877D0782A4CD6B54711FD /* Frameworks */,
160 | );
161 | sourceTree = "";
162 | };
163 | ED8709681EA610A200CB9BC6 /* Products */ = {
164 | isa = PBXGroup;
165 | children = (
166 | ED8709671EA610A200CB9BC6 /* graphql-ios.app */,
167 | );
168 | name = Products;
169 | sourceTree = "";
170 | };
171 | ED8709691EA610A200CB9BC6 /* graphql-ios */ = {
172 | isa = PBXGroup;
173 | children = (
174 | ED52EAF21EA88855000707DB /* Apollo.podspec */,
175 | ED5F68461EC5821C004D3D96 /* README.md */,
176 | ED87098F1EA63F5E00CB9BC6 /* graphql-ios.pch */,
177 | ED87096D1EA610A200CB9BC6 /* AppDelegate.h */,
178 | ED87096E1EA610A200CB9BC6 /* AppDelegate.m */,
179 | ED8709701EA610A200CB9BC6 /* FirstViewController.h */,
180 | ED8709711EA610A200CB9BC6 /* FirstViewController.m */,
181 | ED8709731EA610A200CB9BC6 /* SecondViewController.h */,
182 | ED8709741EA610A200CB9BC6 /* SecondViewController.m */,
183 | ED8709761EA610A200CB9BC6 /* Main.storyboard */,
184 | ED6903631EA722AC0000A8C9 /* API.h */,
185 | ED6903641EA722AC0000A8C9 /* API.m */,
186 | ED8709841EA610CC00CB9BC6 /* Apollo */,
187 | ED8709791EA610A200CB9BC6 /* Assets.xcassets */,
188 | ED87097B1EA610A200CB9BC6 /* LaunchScreen.storyboard */,
189 | ED87097E1EA610A200CB9BC6 /* Info.plist */,
190 | ED87096A1EA610A200CB9BC6 /* Supporting Files */,
191 | );
192 | name = "graphql-ios";
193 | path = Apollo_OC;
194 | sourceTree = "";
195 | };
196 | ED87096A1EA610A200CB9BC6 /* Supporting Files */ = {
197 | isa = PBXGroup;
198 | children = (
199 | ED87096B1EA610A200CB9BC6 /* main.m */,
200 | );
201 | name = "Supporting Files";
202 | sourceTree = "";
203 | };
204 | ED8709841EA610CC00CB9BC6 /* Apollo */ = {
205 | isa = PBXGroup;
206 | children = (
207 | ED8709881EA6113600CB9BC6 /* OperationResultHandler.h */,
208 | ED87099D1EA6412E00CB9BC6 /* CacheKeyForObject.h */,
209 | ED8709851EA610EA00CB9BC6 /* ApolloClient.h */,
210 | ED8709861EA610EA00CB9BC6 /* ApolloClient.m */,
211 | ED8709891EA611EE00CB9BC6 /* FetchQueryOperation.h */,
212 | ED87098A1EA611EE00CB9BC6 /* FetchQueryOperation.m */,
213 | ED87098C1EA6122F00CB9BC6 /* ApolloStore.h */,
214 | ED87098D1EA6122F00CB9BC6 /* ApolloStore.m */,
215 | ED8709D11EA66B0A00CB9BC6 /* AsynchronousOperation.h */,
216 | ED8709D21EA66B0A00CB9BC6 /* AsynchronousOperation.m */,
217 | ED8709AA1EA6481000CB9BC6 /* Field.h */,
218 | ED8709AB1EA6481000CB9BC6 /* Field.m */,
219 | ED8709AD1EA64CA900CB9BC6 /* Fragments.h */,
220 | ED8709AE1EA64CA900CB9BC6 /* Fragments.m */,
221 | ED8709B01EA64CEF00CB9BC6 /* GraphQLError.h */,
222 | ED8709B11EA64CEF00CB9BC6 /* GraphQLError.m */,
223 | ED8709B31EA64D1700CB9BC6 /* GraphQLOperation.h */,
224 | ED8709B41EA64D1700CB9BC6 /* GraphQLOperation.m */,
225 | ED8709B51EA64D1700CB9BC6 /* GraphQLQueryWatcher.h */,
226 | ED8709B61EA64D1700CB9BC6 /* GraphQLQueryWatcher.m */,
227 | ED8709B91EA64D3D00CB9BC6 /* GraphQLResponse.h */,
228 | ED8709BA1EA64D3D00CB9BC6 /* GraphQLResponse.m */,
229 | ED8709BC1EA64D4600CB9BC6 /* GraphQLResult.h */,
230 | ED8709BD1EA64D4600CB9BC6 /* GraphQLResult.m */,
231 | ED8709BF1EA64D5B00CB9BC6 /* GraphQLResultNormalizer.h */,
232 | ED8709C01EA64D5B00CB9BC6 /* GraphQLResultNormalizer.m */,
233 | ED8709A11EA6443E00CB9BC6 /* GraphQLResultReader.h */,
234 | ED8709A21EA6443E00CB9BC6 /* GraphQLResultReader.m */,
235 | ED8709A41EA6471D00CB9BC6 /* GraphQLTypes.h */,
236 | ED8709A51EA6471D00CB9BC6 /* GraphQLTypes.m */,
237 | ED8709C21EA64D8500CB9BC6 /* HTTPNetworkTransport.h */,
238 | ED8709C31EA64D8500CB9BC6 /* HTTPNetworkTransport.m */,
239 | ED8709CB1EA64DC300CB9BC6 /* NetworkTransport.h */,
240 | ED8709CC1EA64DC300CB9BC6 /* NetworkTransport.m */,
241 | ED8709A71EA6478F00CB9BC6 /* JSON.h */,
242 | ED8709A81EA6478F00CB9BC6 /* JSON.m */,
243 | ED8709C71EA64D9600CB9BC6 /* JSONSerializationFormat.h */,
244 | ED8709C81EA64D9600CB9BC6 /* JSONSerializationFormat.m */,
245 | ED6903601EA70EB50000A8C9 /* JSONStandardTypeConversions.h */,
246 | ED6903611EA70EB50000A8C9 /* JSONStandardTypeConversions.m */,
247 | ED87099E1EA6429D00CB9BC6 /* Record.h */,
248 | ED87099F1EA6429D00CB9BC6 /* Record.m */,
249 | ED87099A1EA6401E00CB9BC6 /* RecordSet.h */,
250 | ED87099B1EA6401E00CB9BC6 /* RecordSet.m */,
251 | ED8709C51EA64D9600CB9BC6 /* NSDictionary+JSONEncodable.h */,
252 | ED8709C61EA64D9600CB9BC6 /* NSDictionary+JSONEncodable.m */,
253 | ED8709D71EA66FBA00CB9BC6 /* Cancellable.h */,
254 | ED8709D81EA66FBA00CB9BC6 /* Cancellable.m */,
255 | ED8709991EA63FCF00CB9BC6 /* Utilities */,
256 | );
257 | path = Apollo;
258 | sourceTree = "";
259 | };
260 | ED8709991EA63FCF00CB9BC6 /* Utilities */ = {
261 | isa = PBXGroup;
262 | children = (
263 | ED8709941EA63FBC00CB9BC6 /* ApolloTuple.h */,
264 | ED8709951EA63FBC00CB9BC6 /* ApolloTuple.m */,
265 | ED8709CE1EA64DEF00CB9BC6 /* NSHTTPURLResponse+Utilities.h */,
266 | ED8709CF1EA64DEF00CB9BC6 /* NSHTTPURLResponse+Utilities.m */,
267 | ED6903691EA74C080000A8C9 /* NSArray+Map.h */,
268 | ED69036A1EA74C080000A8C9 /* NSArray+Map.m */,
269 | ED69036D1EA74C7A0000A8C9 /* NSMutableArray+Concat.h */,
270 | ED69036E1EA74C7A0000A8C9 /* NSMutableArray+Concat.m */,
271 | ED6903701EA74C920000A8C9 /* NSSet+Disjoint.h */,
272 | ED6903711EA74C920000A8C9 /* NSSet+Disjoint.m */,
273 | );
274 | name = Utilities;
275 | sourceTree = "";
276 | };
277 | F88877D0782A4CD6B54711FD /* Frameworks */ = {
278 | isa = PBXGroup;
279 | children = (
280 | 941B04D397EF3452436A3031 /* libPods-Apollo_OC.a */,
281 | );
282 | name = Frameworks;
283 | sourceTree = "";
284 | };
285 | /* End PBXGroup section */
286 |
287 | /* Begin PBXNativeTarget section */
288 | ED8709661EA610A200CB9BC6 /* graphql-ios */ = {
289 | isa = PBXNativeTarget;
290 | buildConfigurationList = ED8709811EA610A200CB9BC6 /* Build configuration list for PBXNativeTarget "graphql-ios" */;
291 | buildPhases = (
292 | 9761A556E9B137CA4C99E471 /* [CP] Check Pods Manifest.lock */,
293 | ED8709631EA610A200CB9BC6 /* Sources */,
294 | ED8709641EA610A200CB9BC6 /* Frameworks */,
295 | ED8709651EA610A200CB9BC6 /* Resources */,
296 | B9A574A50007C16AEE3B21E4 /* [CP] Embed Pods Frameworks */,
297 | 715E32751110750C64AF325B /* [CP] Copy Pods Resources */,
298 | );
299 | buildRules = (
300 | );
301 | dependencies = (
302 | );
303 | name = "graphql-ios";
304 | productName = Apollo_OC;
305 | productReference = ED8709671EA610A200CB9BC6 /* graphql-ios.app */;
306 | productType = "com.apple.product-type.application";
307 | };
308 | /* End PBXNativeTarget section */
309 |
310 | /* Begin PBXProject section */
311 | ED87095F1EA610A200CB9BC6 /* Project object */ = {
312 | isa = PBXProject;
313 | attributes = {
314 | LastUpgradeCheck = 0830;
315 | ORGANIZATIONNAME = "Midtown Doornail";
316 | TargetAttributes = {
317 | ED8709661EA610A200CB9BC6 = {
318 | CreatedOnToolsVersion = 8.3;
319 | DevelopmentTeam = ZWR8MWYL3V;
320 | ProvisioningStyle = Automatic;
321 | };
322 | };
323 | };
324 | buildConfigurationList = ED8709621EA610A200CB9BC6 /* Build configuration list for PBXProject "graphql-ios" */;
325 | compatibilityVersion = "Xcode 3.2";
326 | developmentRegion = English;
327 | hasScannedForEncodings = 0;
328 | knownRegions = (
329 | en,
330 | Base,
331 | );
332 | mainGroup = ED87095E1EA610A200CB9BC6;
333 | productRefGroup = ED8709681EA610A200CB9BC6 /* Products */;
334 | projectDirPath = "";
335 | projectRoot = "";
336 | targets = (
337 | ED8709661EA610A200CB9BC6 /* graphql-ios */,
338 | );
339 | };
340 | /* End PBXProject section */
341 |
342 | /* Begin PBXResourcesBuildPhase section */
343 | ED8709651EA610A200CB9BC6 /* Resources */ = {
344 | isa = PBXResourcesBuildPhase;
345 | buildActionMask = 2147483647;
346 | files = (
347 | ED87097D1EA610A200CB9BC6 /* LaunchScreen.storyboard in Resources */,
348 | ED52EAF31EA88855000707DB /* Apollo.podspec in Resources */,
349 | ED87097A1EA610A200CB9BC6 /* Assets.xcassets in Resources */,
350 | ED8709781EA610A200CB9BC6 /* Main.storyboard in Resources */,
351 | );
352 | runOnlyForDeploymentPostprocessing = 0;
353 | };
354 | /* End PBXResourcesBuildPhase section */
355 |
356 | /* Begin PBXShellScriptBuildPhase section */
357 | 715E32751110750C64AF325B /* [CP] Copy Pods Resources */ = {
358 | isa = PBXShellScriptBuildPhase;
359 | buildActionMask = 2147483647;
360 | files = (
361 | );
362 | inputPaths = (
363 | );
364 | name = "[CP] Copy Pods Resources";
365 | outputPaths = (
366 | );
367 | runOnlyForDeploymentPostprocessing = 0;
368 | shellPath = /bin/sh;
369 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Apollo_OC/Pods-Apollo_OC-resources.sh\"\n";
370 | showEnvVarsInLog = 0;
371 | };
372 | 9761A556E9B137CA4C99E471 /* [CP] Check Pods Manifest.lock */ = {
373 | isa = PBXShellScriptBuildPhase;
374 | buildActionMask = 2147483647;
375 | files = (
376 | );
377 | inputPaths = (
378 | );
379 | name = "[CP] Check Pods Manifest.lock";
380 | outputPaths = (
381 | );
382 | runOnlyForDeploymentPostprocessing = 0;
383 | shellPath = /bin/sh;
384 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
385 | showEnvVarsInLog = 0;
386 | };
387 | B9A574A50007C16AEE3B21E4 /* [CP] Embed Pods Frameworks */ = {
388 | isa = PBXShellScriptBuildPhase;
389 | buildActionMask = 2147483647;
390 | files = (
391 | );
392 | inputPaths = (
393 | );
394 | name = "[CP] Embed Pods Frameworks";
395 | outputPaths = (
396 | );
397 | runOnlyForDeploymentPostprocessing = 0;
398 | shellPath = /bin/sh;
399 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Apollo_OC/Pods-Apollo_OC-frameworks.sh\"\n";
400 | showEnvVarsInLog = 0;
401 | };
402 | /* End PBXShellScriptBuildPhase section */
403 |
404 | /* Begin PBXSourcesBuildPhase section */
405 | ED8709631EA610A200CB9BC6 /* Sources */ = {
406 | isa = PBXSourcesBuildPhase;
407 | buildActionMask = 2147483647;
408 | files = (
409 | ED6903651EA722AC0000A8C9 /* API.m in Sources */,
410 | ED8709D31EA66B0A00CB9BC6 /* AsynchronousOperation.m in Sources */,
411 | ED8709C41EA64D8500CB9BC6 /* HTTPNetworkTransport.m in Sources */,
412 | ED8709871EA610EA00CB9BC6 /* ApolloClient.m in Sources */,
413 | ED87099C1EA6401E00CB9BC6 /* RecordSet.m in Sources */,
414 | ED8709BE1EA64D4600CB9BC6 /* GraphQLResult.m in Sources */,
415 | ED8709C91EA64D9600CB9BC6 /* NSDictionary+JSONEncodable.m in Sources */,
416 | ED8709D01EA64DEF00CB9BC6 /* NSHTTPURLResponse+Utilities.m in Sources */,
417 | ED8709B71EA64D1700CB9BC6 /* GraphQLOperation.m in Sources */,
418 | ED8709751EA610A200CB9BC6 /* SecondViewController.m in Sources */,
419 | ED8709D91EA66FBA00CB9BC6 /* Cancellable.m in Sources */,
420 | ED69036B1EA74C080000A8C9 /* NSArray+Map.m in Sources */,
421 | ED87096F1EA610A200CB9BC6 /* AppDelegate.m in Sources */,
422 | ED8709BB1EA64D3D00CB9BC6 /* GraphQLResponse.m in Sources */,
423 | ED8709A61EA6471D00CB9BC6 /* GraphQLTypes.m in Sources */,
424 | ED8709B81EA64D1700CB9BC6 /* GraphQLQueryWatcher.m in Sources */,
425 | ED8709AF1EA64CA900CB9BC6 /* Fragments.m in Sources */,
426 | ED8709AC1EA6481000CB9BC6 /* Field.m in Sources */,
427 | ED87098B1EA611EE00CB9BC6 /* FetchQueryOperation.m in Sources */,
428 | ED8709C11EA64D5B00CB9BC6 /* GraphQLResultNormalizer.m in Sources */,
429 | ED6903721EA74C920000A8C9 /* NSSet+Disjoint.m in Sources */,
430 | ED8709A31EA6443E00CB9BC6 /* GraphQLResultReader.m in Sources */,
431 | ED8709CA1EA64D9600CB9BC6 /* JSONSerializationFormat.m in Sources */,
432 | ED8709CD1EA64DC300CB9BC6 /* NetworkTransport.m in Sources */,
433 | ED8709981EA63FBC00CB9BC6 /* ApolloTuple.m in Sources */,
434 | ED8709A91EA6478F00CB9BC6 /* JSON.m in Sources */,
435 | ED8709721EA610A200CB9BC6 /* FirstViewController.m in Sources */,
436 | ED8709B21EA64CF000CB9BC6 /* GraphQLError.m in Sources */,
437 | ED5F68471EC5821C004D3D96 /* README.md in Sources */,
438 | ED87098E1EA6122F00CB9BC6 /* ApolloStore.m in Sources */,
439 | ED8709A01EA6429D00CB9BC6 /* Record.m in Sources */,
440 | ED6903621EA70EB50000A8C9 /* JSONStandardTypeConversions.m in Sources */,
441 | ED87096C1EA610A200CB9BC6 /* main.m in Sources */,
442 | ED69036F1EA74C7A0000A8C9 /* NSMutableArray+Concat.m in Sources */,
443 | );
444 | runOnlyForDeploymentPostprocessing = 0;
445 | };
446 | /* End PBXSourcesBuildPhase section */
447 |
448 | /* Begin PBXVariantGroup section */
449 | ED8709761EA610A200CB9BC6 /* Main.storyboard */ = {
450 | isa = PBXVariantGroup;
451 | children = (
452 | ED8709771EA610A200CB9BC6 /* Base */,
453 | );
454 | name = Main.storyboard;
455 | sourceTree = "";
456 | };
457 | ED87097B1EA610A200CB9BC6 /* LaunchScreen.storyboard */ = {
458 | isa = PBXVariantGroup;
459 | children = (
460 | ED87097C1EA610A200CB9BC6 /* Base */,
461 | );
462 | name = LaunchScreen.storyboard;
463 | sourceTree = "";
464 | };
465 | /* End PBXVariantGroup section */
466 |
467 | /* Begin XCBuildConfiguration section */
468 | ED87097F1EA610A200CB9BC6 /* Debug */ = {
469 | isa = XCBuildConfiguration;
470 | buildSettings = {
471 | ALWAYS_SEARCH_USER_PATHS = NO;
472 | CLANG_ANALYZER_NONNULL = YES;
473 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
474 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
475 | CLANG_CXX_LIBRARY = "libc++";
476 | CLANG_ENABLE_MODULES = YES;
477 | CLANG_ENABLE_OBJC_ARC = YES;
478 | CLANG_WARN_BOOL_CONVERSION = YES;
479 | CLANG_WARN_CONSTANT_CONVERSION = YES;
480 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
481 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
482 | CLANG_WARN_EMPTY_BODY = YES;
483 | CLANG_WARN_ENUM_CONVERSION = YES;
484 | CLANG_WARN_INFINITE_RECURSION = YES;
485 | CLANG_WARN_INT_CONVERSION = YES;
486 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
487 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
488 | CLANG_WARN_UNREACHABLE_CODE = YES;
489 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
490 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
491 | COPY_PHASE_STRIP = NO;
492 | DEBUG_INFORMATION_FORMAT = dwarf;
493 | ENABLE_STRICT_OBJC_MSGSEND = YES;
494 | ENABLE_TESTABILITY = YES;
495 | GCC_C_LANGUAGE_STANDARD = gnu99;
496 | GCC_DYNAMIC_NO_PIC = NO;
497 | GCC_NO_COMMON_BLOCKS = YES;
498 | GCC_OPTIMIZATION_LEVEL = 0;
499 | GCC_PREPROCESSOR_DEFINITIONS = (
500 | "DEBUG=1",
501 | "$(inherited)",
502 | );
503 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
504 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
505 | GCC_WARN_UNDECLARED_SELECTOR = YES;
506 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
507 | GCC_WARN_UNUSED_FUNCTION = YES;
508 | GCC_WARN_UNUSED_VARIABLE = YES;
509 | IPHONEOS_DEPLOYMENT_TARGET = 10.3;
510 | MTL_ENABLE_DEBUG_INFO = YES;
511 | ONLY_ACTIVE_ARCH = YES;
512 | SDKROOT = iphoneos;
513 | };
514 | name = Debug;
515 | };
516 | ED8709801EA610A200CB9BC6 /* Release */ = {
517 | isa = XCBuildConfiguration;
518 | buildSettings = {
519 | ALWAYS_SEARCH_USER_PATHS = NO;
520 | CLANG_ANALYZER_NONNULL = YES;
521 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
522 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
523 | CLANG_CXX_LIBRARY = "libc++";
524 | CLANG_ENABLE_MODULES = YES;
525 | CLANG_ENABLE_OBJC_ARC = YES;
526 | CLANG_WARN_BOOL_CONVERSION = YES;
527 | CLANG_WARN_CONSTANT_CONVERSION = YES;
528 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
529 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
530 | CLANG_WARN_EMPTY_BODY = YES;
531 | CLANG_WARN_ENUM_CONVERSION = YES;
532 | CLANG_WARN_INFINITE_RECURSION = YES;
533 | CLANG_WARN_INT_CONVERSION = YES;
534 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
535 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
536 | CLANG_WARN_UNREACHABLE_CODE = YES;
537 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
538 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
539 | COPY_PHASE_STRIP = NO;
540 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
541 | ENABLE_NS_ASSERTIONS = NO;
542 | ENABLE_STRICT_OBJC_MSGSEND = YES;
543 | GCC_C_LANGUAGE_STANDARD = gnu99;
544 | GCC_NO_COMMON_BLOCKS = YES;
545 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
546 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
547 | GCC_WARN_UNDECLARED_SELECTOR = YES;
548 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
549 | GCC_WARN_UNUSED_FUNCTION = YES;
550 | GCC_WARN_UNUSED_VARIABLE = YES;
551 | IPHONEOS_DEPLOYMENT_TARGET = 10.3;
552 | MTL_ENABLE_DEBUG_INFO = NO;
553 | SDKROOT = iphoneos;
554 | VALIDATE_PRODUCT = YES;
555 | };
556 | name = Release;
557 | };
558 | ED8709821EA610A200CB9BC6 /* Debug */ = {
559 | isa = XCBuildConfiguration;
560 | baseConfigurationReference = 98F61DE28BF357E0C8CA78D1 /* Pods-Apollo_OC.debug.xcconfig */;
561 | buildSettings = {
562 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
563 | DEVELOPMENT_TEAM = ZWR8MWYL3V;
564 | GCC_PREFIX_HEADER = "Apollo_OC/graphql-ios.pch";
565 | INFOPLIST_FILE = Apollo_OC/Info.plist;
566 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
567 | PRODUCT_BUNDLE_IDENTIFIER = "Midtown-Doornail.Apollo-OC";
568 | PRODUCT_NAME = "$(TARGET_NAME)";
569 | };
570 | name = Debug;
571 | };
572 | ED8709831EA610A200CB9BC6 /* Release */ = {
573 | isa = XCBuildConfiguration;
574 | baseConfigurationReference = 421EFCEF52199683BB61B243 /* Pods-Apollo_OC.release.xcconfig */;
575 | buildSettings = {
576 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
577 | DEVELOPMENT_TEAM = ZWR8MWYL3V;
578 | GCC_PREFIX_HEADER = "Apollo_OC/graphql-ios.pch";
579 | INFOPLIST_FILE = Apollo_OC/Info.plist;
580 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
581 | PRODUCT_BUNDLE_IDENTIFIER = "Midtown-Doornail.Apollo-OC";
582 | PRODUCT_NAME = "$(TARGET_NAME)";
583 | };
584 | name = Release;
585 | };
586 | /* End XCBuildConfiguration section */
587 |
588 | /* Begin XCConfigurationList section */
589 | ED8709621EA610A200CB9BC6 /* Build configuration list for PBXProject "graphql-ios" */ = {
590 | isa = XCConfigurationList;
591 | buildConfigurations = (
592 | ED87097F1EA610A200CB9BC6 /* Debug */,
593 | ED8709801EA610A200CB9BC6 /* Release */,
594 | );
595 | defaultConfigurationIsVisible = 0;
596 | defaultConfigurationName = Release;
597 | };
598 | ED8709811EA610A200CB9BC6 /* Build configuration list for PBXNativeTarget "graphql-ios" */ = {
599 | isa = XCConfigurationList;
600 | buildConfigurations = (
601 | ED8709821EA610A200CB9BC6 /* Debug */,
602 | ED8709831EA610A200CB9BC6 /* Release */,
603 | );
604 | defaultConfigurationIsVisible = 0;
605 | defaultConfigurationName = Release;
606 | };
607 | /* End XCConfigurationList section */
608 | };
609 | rootObject = ED87095F1EA610A200CB9BC6 /* Project object */;
610 | }
611 |
--------------------------------------------------------------------------------