@@ -2,13 +2,12 @@ import { OpaqueToken, Injectable, Inject } from '@angular/core';
2
2
import { rxify } from 'apollo-client-rxjs' ;
3
3
import { ApolloClient , ApolloQueryResult , WatchQueryOptions , MutationOptions , SubscriptionOptions } from 'apollo-client' ;
4
4
import { Observable } from 'rxjs/Observable' ;
5
+ import { from } from 'rxjs/observable/from' ;
6
+ import { fromPromise } from 'rxjs/observable/fromPromise' ;
5
7
import { FragmentDefinition } from 'graphql' ;
6
8
7
9
import { ApolloQueryObservable } from './ApolloQueryObservable' ;
8
10
9
- import 'rxjs/add/observable/from' ;
10
- import 'rxjs/add/observable/fromPromise' ;
11
-
12
11
export interface DeprecatedWatchQueryOptions extends WatchQueryOptions {
13
12
fragments ?: FragmentDefinition [ ] ;
14
13
}
@@ -27,18 +26,18 @@ export class Angular2Apollo {
27
26
}
28
27
29
28
public query ( options : DeprecatedWatchQueryOptions ) : Observable < ApolloQueryResult > {
30
- return Observable . fromPromise ( this . client . query ( options ) ) ;
29
+ return fromPromise ( this . client . query ( options ) ) ;
31
30
}
32
31
33
32
public mutate ( options : MutationOptions ) : Observable < ApolloQueryResult > {
34
- return Observable . fromPromise ( this . client . mutate ( options ) ) ;
33
+ return fromPromise ( this . client . mutate ( options ) ) ;
35
34
}
36
35
37
36
public subscribe ( options : SubscriptionOptions ) : Observable < any > {
38
37
if ( typeof this . client . subscribe === 'undefined' ) {
39
38
throw new Error ( `Your version of ApolloClient doesn't support subscriptions` ) ;
40
39
}
41
40
42
- return Observable . from ( this . client . subscribe ( options ) ) ;
41
+ return from ( this . client . subscribe ( options ) ) ;
43
42
}
44
43
}
0 commit comments