import { Injectable } from '@angular/core' ; import { Apollo } from 'apollo-angular' ; import gql from 'graphql-tag' ; import { Observable } from 'rxjs/Rx' ; import { GET_TWEETS } from '../subscription/tweet.subscription' ; @ Injectable ( ) export class TweetService { constructor ( private apollo ) { } getTweets ( ) { return this . apollo . subscribe ( { query : gql `${ GET_TWEETS }` } ) ; } }