Repository URL to install this package:
|
Version:
0.6.2 ▾
|
import { ApolloLink } from 'apollo-link'
/**
* @see https://github.com/apollographql/apollo-link/tree/master/packages/apollo-link-error
* @todo https://www.apollographql.com/docs/link/index.html#graphql-tools custom fetcher?
*/
const consoleLink = new ApolloLink((operation, forward) => {
console.info(`starting request for ${operation.operationName}`)
if (forward) {
return forward(operation).map(data => {
console.info(`ending request for ${operation.operationName}`)
return data
})
} else {
return null
}
})
export default consoleLink