import { Operation , NextLink , FetchResult } from '../types' ; import Observable from 'zen-observable-ts' ; import { ApolloLink } from '../link' ; export default class SetContextLink extends ApolloLink { constructor ( private setContext = c => c ) { super ( ) ; } public request ( operation , forward ) { operation . setContext ( this . setContext ( operation . getContext ( ) ) ) ; return forward ( operation ) ; } }