Created
February 16, 2019 21:17
-
-
Save hwillson/01ab7f9bc2a18e6d842d60705756382c to your computer and use it in GitHub Desktop.
Apollo Client - 2.5.0 Announcement Post - Code Splitting 1
This file contains 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 { render } from 'react-dom'; | |
import { BrowserRouter as Router } from 'react-router-dom'; | |
import { ApolloClient } from 'apollo-client'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { ApolloProvider } from 'react-apollo'; | |
import App from './components/App'; | |
const client = new ApolloClient({ | |
cache: new InMemoryCache(), | |
link: new HttpLink({ | |
uri: 'http://localhost:4000/graphql', | |
}), | |
}); | |
render( | |
<ApolloProvider client={client}> | |
<Router> | |
<App /> | |
</Router> | |
</ApolloProvider>, | |
document.getElementById('root'), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment