/RxApolloClient

RxSwift extensions for Apollo Client

Primary LanguageSwiftMIT LicenseMIT

RxApolloClient

CI Status Version License Platform

Get Started

  1. Install Apollo
$ npm install -g apollo 1.9.2
  1. Fetch Scheme & Generate API Code

get_gql.sh

cd ____ # project folder
apollo schema:download _______/schema.json --endpoint=__________ # scheme.json location  / end point url
apollo codegen:generate --queries="$(find . -name '*.graphql')" --schema=_______/schema.json _______/GraphQLAPI.swift # scheme.json location / generated API code location
$ sh get_gql.sh

Dependencies

Requirements

  • Xcode 10.0
  • Swift 4.2

Installation

RxApolloClient is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'RxApolloClient'

Usage

Fetch

client.rx
  .fetch(query: SearchRepositoriesQuery(query: "test"))

Watch

client.rx
  .watch(query: SearchRepositoriesQuery(query: "test"))

Mutate

client.rx
  .perform(mutation: AddStarMutation(id: "test"))

Example

Author

OhKanghoon, ggaa96@naver.com

License

RxApolloClient is available under the MIT license. See the LICENSE file for more info.