import { Injectable } from '@angular/core' ; import { Apollo } from 'apollo-angular' ; import { map , take } from 'rxjs/operators' ; @ Injectable ( { providedIn : 'root' } ) export class LikeService { constructor ( private apollo ) { } /**
     * LikeOrDislike
     */ public likeOrDisLike ( filteredInfo ) { const mutation = filteredInfo [ 'mutation' ] ; delete filteredInfo [ 'mutation' ] ; return this . apollo . mutate < any > ( { mutation : mutation , variables : filteredInfo } ) . pipe ( take ( 1 ) ) . pipe ( map ( ( res ) => { return res ; } ) ) ; } }