import React, { Component } from 'react'
import ApolloClient from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { ApolloProvider } from 'react-apollo';
import Router from './router'

class App extends Component {
  createClient() {
    // Initialize Apollo Client with URL to our server
    return new ApolloClient({
    link: new HttpLink({ uri: 'https://api.github.com/graphql' }),
    cache: new InMemoryCache(),
    })
  }
  render () {
    return (
      <ApolloProvider client={this.createClient()}>
        <Router />
      </ApolloProvider>
    )
  }
}

export default App

@@ -84,16 +84,63 @@
 mport %7B 
+ApolloLink %7D from 'apollo-link'%0Aimport %7B create
 HttpLink
@@ -166,16 +166,16 @@
 k-http'%0A
-
 import %7B
@@ -343,24 +343,372 @@
 eClient() %7B%0A
+    const httpLink = createHttpLink(%7B uri: 'https://api.github.com/graphql'%7D)%0A    const middleareLink =  new ApolloLink((operation, forward) =%3E %7B%0A      operation.setContext(%7B%0A        headers: %7B%0A          authorization: 'GITHUB_ACCESS_TOKEN'%0A        %7D%0A      %7D)%0A      return forward(operation)%0A    %7D)%0A    const link = middleareLink.concat(httpLink)%0A%0A
     // Initi
@@ -794,63 +794,12 @@
 nk: 
-new HttpLink(%7B uri: 'https://api.github.com/graphql' %7D)
+link
 ,%0A  

add authentication middleware to apollo client