Search in sources :

Example 1 with WebmQuery

use of com.example.aleksejkocergin.myapplication.WebmQuery in project RandomWebm by alkocher.

the class WebmDetailsFetcher method fetchWebmDetails.

public void fetchWebmDetails() {
    ApolloCall<WebmQuery.Data> webmQuery = WebmApolloClient.getWebmApolloClient().query(new WebmQuery(webmId));
    disposable.add(Rx2Apollo.from(webmQuery).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribeWith(new DisposableObserver<Response<WebmQuery.Data>>() {

        @Override
        public void onNext(Response<WebmQuery.Data> dataResponse) {
            webmData.render(dataResponse.data());
        }

        @Override
        public void onError(Throwable e) {
            webmData.showErrorSnackbar();
        }

        @Override
        public void onComplete() {
        }
    }));
}
Also used : Response(com.apollographql.apollo.api.Response) DisposableObserver(io.reactivex.observers.DisposableObserver) WebmQuery(com.example.aleksejkocergin.myapplication.WebmQuery) WebmData(com.example.aleksejkocergin.randomwebm.interfaces.WebmData)

Aggregations

Response (com.apollographql.apollo.api.Response)1 WebmQuery (com.example.aleksejkocergin.myapplication.WebmQuery)1 WebmData (com.example.aleksejkocergin.randomwebm.interfaces.WebmData)1 DisposableObserver (io.reactivex.observers.DisposableObserver)1