GraphQL (Apollo) API Request by RxSwift
pod 'RxCocoa'
pod 'RxSwift'
pod 'Apollo'
pod "Apollo/SQLite"
pod "Apollo/WebSocket"
- Download and drop
RRAPIRxManager.swift
in your project. - Add your GraphQL scema.json file and API end point URL in your project.
- Setup Apollo Client: https://www.apollographql.com/docs/ios/installation/
- Congratulations!
To run the example project, clone the repo, and run pod install from the Example directory first.
var query: HomeQuery {
return HomeQuery(slug: "home")
}
APIManager.shared.rxFetch(query: query)
.subscribeOn(RXScheduler.concurrentBackground)
.observeOn(RXScheduler.main)
.subscribe(onSuccess: { response in
print(response)
}, onError: { error in
print(error)
}).disposed(by: rxbag)
We would love you for the contribution to RRApolloRxAPI, check the LICENSE
file for more info.
RRApolloRxAPI is available under the MIT license. See the LICENSE file for more info.