import { ApolloClient , WatchQueryOptions } from 'apollo-client' ; import { RxObservableQuery } from './RxObservableQuery' ; import { createWithObservableVariables } from './utils/variables' ; export class RxApolloClient extends ApolloClient { constructor ( options ) { super ( options ) ; } public watchQuery ( options ) { if ( typeof options . variables === 'object' ) { return createWithObservableVariables ( options , super . watchQuery . bind ( this ) ) ; } return new RxObservableQuery ( super . watchQuery ( options ) ) ; } }