Add empty console link
This commit is contained in:
parent
d3a65539fb
commit
c401bc4d91
|
|
@ -1,6 +1,7 @@
|
|||
import {InMemoryCache} from 'apollo-cache-inmemory/lib/index'
|
||||
import {HttpLink} from 'apollo-link-http/lib/index'
|
||||
import {ApolloClient} from 'apollo-client/index'
|
||||
import {ApolloLink} from 'apollo-link'
|
||||
import fetch from 'unfetch'
|
||||
|
||||
const httpLink = new HttpLink({
|
||||
|
|
@ -12,10 +13,22 @@ const httpLink = new HttpLink({
|
|||
}
|
||||
})
|
||||
|
||||
const consoleLink = new ApolloLink((operation, forward) => {
|
||||
console.log(`starting request for ${operation.operationName}`);
|
||||
|
||||
return forward(operation).map((data) => {
|
||||
console.log(`ending request for ${operation.operationName}`);
|
||||
|
||||
return data
|
||||
})
|
||||
})
|
||||
|
||||
const composedLink = ApolloLink.from([consoleLink, httpLink]);
|
||||
|
||||
// Create the apollo client
|
||||
export default new ApolloClient({
|
||||
// link: composedLink,
|
||||
link: httpLink,
|
||||
link: composedLink,
|
||||
// link: httpLink,
|
||||
cache: new InMemoryCache(),
|
||||
connectToDevTools: true
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue