All Projects → scottrhoyt → RxApollo

scottrhoyt / RxApollo

Licence: MIT License
RxSwift extensions for Apollo

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
shell
77523 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to RxApollo

RxApolloClient
RxSwift extensions for Apollo Client
Stars: ✭ 46 (-19.3%)
Mutual labels:  apollo, rxswift
rn-chat
Chat app made with React Native, NativeBase, Apollo Hooks and Sequelize.
Stars: ✭ 37 (-35.09%)
Mutual labels:  apollo
RxJSON
RxSwift wrapper for JSON
Stars: ✭ 33 (-42.11%)
Mutual labels:  rxswift
apollo-chat-graphql-server
Apollo Chat is a Chat Service build on GraphQL Apollo with Subscriptions
Stars: ✭ 13 (-77.19%)
Mutual labels:  apollo
stuyspec.com
🖼 The Stuyvesant Spectator's website, built with React, GraphQL, and Rails.
Stars: ✭ 22 (-61.4%)
Mutual labels:  apollo
RxEureka
This library is a small RxSwift wrapper around Eureka
Stars: ✭ 37 (-35.09%)
Mutual labels:  rxswift
kontent-boilerplate-express-apollo
Kontent Boilerplate for development of Express application using Apollo server and GraphQL.
Stars: ✭ 21 (-63.16%)
Mutual labels:  apollo
apollo-error-converter
Global Apollo Server Error handling made easy. Remove verbose and repetitive resolver / data source Error handling. Automatic Error catching, logging, and conversion to ApolloErrors.
Stars: ✭ 16 (-71.93%)
Mutual labels:  apollo
Mp3ID3Tagger
🎶🎵A macOS application to edit the ID3 tag of your mp3 files. Developed with RxSwift and RxCocoa. 🎸🎼
Stars: ✭ 17 (-70.18%)
Mutual labels:  rxswift
cadhub
We're out to raise awareness and put CodeCAD on the map. The success of CadHub can be measured by the amount it promotes the use of CodeCAD within the mechanical/manufacturing industry and the strength the CadHub community.
Stars: ✭ 204 (+257.89%)
Mutual labels:  apollo
RxTask
An RxSwift implementation of a command line runner.
Stars: ✭ 14 (-75.44%)
Mutual labels:  rxswift
apollo-rs
Spec compliant GraphQL Tools in Rust.
Stars: ✭ 314 (+450.88%)
Mutual labels:  apollo
React-Realtime-Chat
A full-stack reproduction of the popular realtime chat application, Slack (http://slack.com) using React and GraphQL Subscriptions.
Stars: ✭ 16 (-71.93%)
Mutual labels:  apollo
apollo-docker
Apollo阿波罗配置中心docker
Stars: ✭ 23 (-59.65%)
Mutual labels:  apollo
netlify-faunadb-graphql-auth
Netlify functions example with faunadb, graphql, and authorization
Stars: ✭ 57 (+0%)
Mutual labels:  apollo
graphql-fundamentals
A training repo for learning basic concepts in GraphQL on the client and server
Stars: ✭ 15 (-73.68%)
Mutual labels:  apollo
udacity-alumni-fe
A front-end web application and bespoke publishing platform, built by Udacity Alumni for Udacity Alumni
Stars: ✭ 45 (-21.05%)
Mutual labels:  apollo
Ocelot-Social
Free and open-source social network for active citizenship.
Stars: ✭ 49 (-14.04%)
Mutual labels:  apollo
ios-architecture-example
Architecture pattern simple examples in iOS. You can compare differences in MVC, MVP, MVVM-Delegate and MVVM-Rx for same feature
Stars: ✭ 16 (-71.93%)
Mutual labels:  rxswift
bs-graphql-bindings
BuckleScript binding for graphql-js
Stars: ✭ 50 (-12.28%)
Mutual labels:  apollo

RxApollo

RxSwift extensions for Apollo.

Installation

Carthage

github "scottrhoyt/RxApollo"

Manual

Add RxApollo.swift to your project.

Usage

All the reactive extensions are encapsulated in the rx property of an ApolloClient.

import Apollo
import RxSwift
import RxApollo

let apollo: ApolloClient
let disposeBag = DisposeBag()

Fetch

Fetching works just how you would expect it to:

// Let's get our hero's name and print it or the error if there is one.
apollo.rx.fetch(query: HeroNameQuery())
  .map { $0.hero?.name }
  .subscribe(onNext: { heroName in
    print("Our hero's name is \(heroName).")
  }, onError: { error in
    print("Received error: \(error).")
  })
  .disposed(by: disposeBag)

Watch

// Let's watch to see if our hero's name changes and print it or the error if there is one.
apollo.rx.watch(query: HeroNameQuery())
  .map { $0.hero?.name }
  .subscribe(onNext: { heroName in
    print("Our hero's name is \(heroName).")
  }, onError: { error in
    print("Received error: \(error).")
  })
  .disposed(by: disposeBag)

Watching also works quite well with using RxCocoa bindings:

import RxCocoa

let heroField: UITextField

// Let's watch to see if our hero's name changes and set a text field.
apollo.rx.watch(query: HeroNameQuery())
  .map { $0.hero?.name }
  .asDriver(onErrorJustReturn: nil)
  .drive(heroField.rx.text)
  .disposed(by: disposeBag)

Mutate

Mutations follow the same pattern as well:

// Let's upvote a post.
apollo.rx.perform(mutation: UpvotePostMutation(postId: postId))
  .subscribe()
  .disposed(by: disposeBag)

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].