This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Authentication Link Example from https://www.apollographql.com/docs/react/recipes/authentication.html#Header | |
import { ApolloClient } from 'apollo-client'; | |
import { createHttpLink } from 'apollo-link-http'; | |
import { setContext } from 'apollo-link-context'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
const httpLink = createHttpLink({ | |
uri: '/graphql', | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ApolloProvider } from 'react-apollo'; | |
import { Provider } from 'react-redux'; | |
import hoistNonReactStatic from 'hoist-non-react-statics'; | |
export default apolloAndReduxProviderHOC = (WrappedComponent, store, client) => { | |
class Enhance extends React.Component { | |
render () { | |
return ( | |
<Provider store={store}> |