Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/create-apollo-client / src / links / consoleLink.ts
Size: Mime:
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